LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   System command from PHP (https://www.linuxquestions.org/questions/linux-newbie-8/system-command-from-php-554129/)

Richtown 05-15-2007 02:39 PM

System command from PHP
 
HI,

To cut a long story short i want to be able to run this "cd /root/Desktop ; tar xvf /tmp/backup"command from my php interface.

Ive tried:
shell_exec("cd /root/Desktop ; tar xvf /tmp/backup")

To create the file in /opt/lampp/htdocs, then try and run the file.
vi runme
#start of file
cd /root/Desktop ; tar xvf /tmp/backup
'end of file
shell_exec("/opt/lampp/htdocs/runme");

ive tried to include the line in /etc/init.d/backup
but the sytnax i use doesnt seem to work.

Does anyone know of a way i can do this?

Thanks Rich

debulu 05-16-2007 10:15 AM

Whats the output/error ?? Try looking in http log files for errors.


All times are GMT -5. The time now is 11:39 PM.