2

How to execute /home/scripts/test.sh file in php

Previously i have placed 'test.sh' file in the /usr/bin and calling in my php file like this

exec('test.sh ' . escapeshellarg($testString)); 

But for security reasons i moved .sh file to /home/scripts directory and in my php i am calling like this

exec('/home/scripts/test.sh ' . escapeshellarg($testString)); 

But it is not working now.

Please suggest me how to achieve this.

vvr
  • 135

1 Answers1

1

Check the value of return_var and display the value of output - this will probably tell you that you have the wrong permissions set on either /home, /home/scripts or on /home/scripts/test.sh.