The root user executes the command for/usr/local/php/bin/php-f/usr/local/apache2/htdocs/test.php
test.php permissions are:-rwxr-xr-x. 1 root root 22 April 15:04 test.php
The result is: PHP Fatal error:Unknown:Failed opening required '/usr/local/apache2/htdocs/test.php ' (include_path= '.:/ Usr/local/php/lib/php ') in Unknown on line 0
Fatal error:Unknown:Failed opening required '/usr/local/apache2/htdocs/test.php ' (include_path= '.:/ Usr/local/php/lib/php ') in Unknown on line 0
Humbly consult, I first run PHP on Linux, one day, have not done well.
Reply to discussion (solution)
See if the file directory location is correct
Run path?
When the PHP command line runs, the initial path is the path where the path is running, not the PHP file, and all the relative paths inside are calculated from the initial path.
It is clear that there is no such file/usr/local/apache2/htdocs/test.php.
Fatal error:Unknown:Failed opening required '/usr/local/apache2/htdocs/test.php ' (include_path= '.:/ Usr/local/php/lib/php ') in Unknown on line 0
Should be a relative path, please change to absolute path
It is clear that there is no such file/usr/local/apache2/htdocs/test.php.
Fatal error:Unknown:Failed opening required '/usr/local/apache2/htdocs/test.php ' (include_path= '.:/ Usr/local/php/lib/php ') in Unknown o ...
Hello, it seems that it is not a relative path caused, suppose I execute a file that does not, for example:
[Root@localhost htdocs]#/usr/local/php/bin/php-f/usr/local/apache2/htdocs/test322323.php
Could not open input file:/usr/local/apache2/htdocs/test322323.php
The hint is could not open input file. This means that the file was found.
Run path?
When the PHP command line runs, the initial path is the path where the path is running, not the PHP file, and all the relative paths inside are calculated from the initial path.
Hello, do not understand, can you explain it concretely. Thank you
[Root@localhost htdocs]#/usr/local/php/bin/php4-f/usr/local/apache2/htdocs/test.php
-bash:/usr/local/php/bin/php4: No file or directory
Similarly, I changed PHP to PhP4, suggesting that "there is no file or directory", which means that PHP can also be found
Linux does not understand, Windows command line is like this
Suppose Aaa.php has an include in it. /bbb.php
c:\abc>php d:\xxx\aaa.php
At this time, the program will look for c:\bbb.php, and error can not find, because bbb.php is present in D:\ of this directory
To make the best use of __dir__ and __file__
Authority, what's the matter? Your mistakes are all include, it's definitely a path problem.
has been resolved. The reason is consistent with the reasons on the following page.
Http://www.cnblogs.com/zcy_soft/archive/2012/12/27/2835757.html
Just solve it.
Really complicated problem, fortunately I have no ignorance, do not study this ... pass
And so on, and then depressed to Google two or three days good
has been resolved. The reason is consistent with the reasons on the following page.
Http://www.cnblogs.com/zcy_soft/archive/2012/12/27/2835757.html
This reason ah, actually want to say the landlord still did not put the details of the problem, your problem and we guess is not one thing, cause bad to find the reason.
Oh, it was PHP code problem
But none of you have asked the landlord what is the program content
Take it for granted, the piecemeal.