note 30549 deleted from function.shell-exec by cmb
| From: | cmb@php.net | Date: | Sun, 07 Jul 2019 15:29:10 +0000 |
| Subject: | note 30549 deleted from function.shell-exec by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211522@lists.php.net to get a copy of this message | ||
Note Submitter: ron dot petty at unigeek dot com
----
Here is an example on how to install software using php
shell_exec("cd /usr/local/src/; gunzip program.tar.gz; tar xvf program.tar; cd program;
./configure; make; make install);
Now depending if your root or not some commands like "make install" may fail. This
doesn't do any error checking, the reason for that is I do not know how to cd to a directory
and then execute another command unless they are in the same shell.
So basically, take what you type on the command line and string them together.