I have a shell script in the /home/
directory. I'd like to execute it by using a web page. The webserver is located in /var/www/.
I'm wondering how would I execute the shell script from within the homepage using PHP?
I'm using Ubuntu Server.
exec('/path/to/shell/script');
However this will only work if safe_mode is disabled, php has permissions to such folder and file, or is defined in your basedir.
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.