I am developing for first time a WordPress plugin. I have two .php (file1.php, file2.php). In file1.php I have defined a form with a action to file2.php for upload images. In file2.php I just do a
require_once('./wp-admin/includes/file.php');
but I receive this error
NetworkError: 500 Internal Server Error - http://localhost/wordpress/wp-content/plugins/file2.php
I tried with require_once()
, include()
, with the entire route, etc. I reviewed permissions, routes and it's correct. I tried the require_once()
in file1.php and it works but I need it in file2.php.
Any ideas? Thanks in advance.
Deploying the logs:
require_once('./wp-admin/includes/file.php');
Warning: require_once(./wp-admin/includes/file.php): failed to open stream: No such file or directory in /var/www/html/wordpress/wp-content/plugins/file2.php on line 15
Fatal error: require_once(): Failed opening required './wp-admin/includes/file.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/wordpress/wp-content/plugins/file2.php on line 15
require_once('/var/www/html/wordpress/wp-admin/includes/file.php');
Fatal error: Call to undefined function __() in /var/www/html/wordpress/wp-admin/includes/file.php on line 16
This error is to a WordPress function, so I suppose that it is not the error, it will be another but....