The centos server has installed the phantomjs binary file because it needs to call phantomjs. In addition, it has tried to output phantomjs -- version on putty: 1.9.8. then I tried: {code ...} wondering, try again: {code ...} google for a long time, some people... the centos server has installed the phantomjs binary file because it needs to call phantomjs. In addition, it has tried to output phantomjs -- version on putty: 1.9.8.
Then I tried:
Exec ("phantomjs -- version", $ o, $ e); echo $ e; // 127 is returned.
Wondering, try again:
Exec ("ls", $ o, $ e); echo $ e; // still returns 127
Google has been around for a long time. Some people say they want to adopt an absolute path. Then they try again:
#which ls/bin/ls
Then input the following in php:
Exec ("/bin/ls", $ o, $ e); echo $ e; // returns 127
View php. ini, safe_mode = Off, and the exec () and system () functions are not disabled in disble_functions. It is reasonable to say that php should have the permission to execute exec and change it to system (), all shell_exec returns 127. I am crazy. Please help me solve this. The exec function should be used in all cases.
Reply content:
The centos server has installed the phantomjs binary file because it needs to call phantomjs. In addition, it has tried to output phantomjs -- version on putty: 1.9.8.
Then I tried:
Exec ("phantomjs -- version", $ o, $ e); echo $ e; // 127 is returned.
Wondering, try again:
Exec ("ls", $ o, $ e); echo $ e; // still returns 127
Google has been around for a long time. Some people say they want to adopt an absolute path. Then they try again:
#which ls/bin/ls
Then input the following in php:
Exec ("/bin/ls", $ o, $ e); echo $ e; // returns 127
View php. ini, safe_mode = Off, and the exec () and system () functions are not disabled in disble_functions. It is reasonable to say that php should have the permission to execute exec and change it to system (), all shell_exec returns 127. I am crazy. Please help me solve this. The exec function should be used in all cases.
Check your current PHP script user
I tested it with the root user. There is no error.
Exec or system commands should first be run by the script user with the permission to execute this program.