1
I have a virtual server with Linux-Debian operating system, which is configured as Nginx web server and Firebird database. I have a script that performs a Firebird restart routine and executes it when a crash occurs. My script, which is located in: '/scripts/restart_firebird.sh' I can run it normally for SSH. The need arose to put the script to run through a request through a PHP script. The command used is:
$output = shell_exec("/scripts/restart_firebird.sh");
echo $output;
When executing, I get the message:
Stopping Firebird 2.5 superclassic server....
I checked the Firebird log files located in '/var/log' but this error is not being recorded.
Contents of the sh script:
firebird2.5-superclassic Restart service
There must be some problem with Nginx user permissions when trying to run the script. To be sure, try to log in with your Nginx user on the server and run the script.
– Celso Marigo Jr
@Celsomarigojr, the user of Nginx is 'www-data'. I tried to run the script by SSH with this user and the error message it shows is: service: not found. How could I give this user permission?
– Carlos Andrade