简体   繁体   中英

php exec not working properly on remote server

php functions like exec and shell_exec work fine on localhost but it doesn't work properly on remote host.

$output = shell_exec('dir');

echo "<pre>$output</pre>";

This code gives output in localhost but not at remote server. Any Clue?

This kind of php commands are usually disabled on remote web servers. If you really want them to works, you should use a dedicated server and configure it yourself.

dir command is in windows system, so is your remote server a windows server too?

Even it is a windows server, the configure may be different from your local machine that disables shell_exec

看一下http://php.net/globhttp://php.net/manual/en/class.directoryiterator.php对我来说,执行dirls根本没有任何意义。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM