[PLUG] Running programs from Apache.
michael
michael at robinson-west.com
Mon Dec 11 21:20:39 UTC 2017
I need to get the following script to work:
pi at raspberrypi:/var/www/php $ cat startup.php
<?php
exec("cd /opt/apex/bin && ./stop.sh && ./start.sh");
?>
when called by Apache server.
pi at raspberrypi:/opt/apex/bin $ ls -la
total 288
dr-xr-x--- 2 pi pi 4096 Dec 11 14:20 .
drwxr-xr-x 7 root root 4096 Dec 7 16:50 ..
-r-xr-x--- 1 pi www-data 255940 Dec 11 09:54 controller
-r-xr-x--- 1 pi www-data 268 Dec 7 11:52 kill.sh
-r-xr-x--- 1 pi www-data 420 Dec 11 14:54 start.sh
-r--r----- 1 pi pi 459 Dec 11 15:08 .startup.sh
lrwxrwxrwx 1 root root 7 Dec 8 13:02 stop.sh -> kill.sh
-r-xr-x--- 1 pi www-data 7536 Dec 7 09:24 tcp_client
-r-xr-x--- 1 pi www-data 6269 Dec 7 09:24 udp_client
The pi user can run stop.sh and start.sh, but www-data seemingly cannot.
More information about the PLUG
mailing list