Part 1
In my CentOS 7x, i have my C++ binary located in /var/tmp/sip-dialer/reminder-call.
Which is executed using following BASH
reminder-call.sh:
#!/bin/bash
cd /var/tmp/sip-dialer
./redminder-call -P sip -u GokuPower -c 1234 -w reminder.myvoipserver.com -x "call003248181919;wakeupItsMorning;sleep3000;hangup"
On execute the whole setup works perfectly fine (Part 1).
Part 2:
Now i need to call my BASH script from Android, iOS, Tizen and via other WebServices such as https://cow:[email protected]/run.php .
So in my ZF2, PHP i have following:
<?php
$output = shell_exec('/home/www/html/sip-phone/reminder-call.sh');
echo "executed";
?>
When i call the PHP to execute that BASH script it fails to execute with following:
/home/www/html/sip-phone/reminder-call.sh: line 3: ./redminder-call: No such file or directory
What is happening? Manually BASH script works but involving PHP to execute the same thing is failing.
/home/www/html/sip-phone/reminder-call.shto see if php has access to/home/www/html/sip-phone/reminder-call.shwith privileges php has on execution?chmod -R 777 /home/www/html/sip-phone/reminder-call.sh; chmod +x /home/www/html/sip-phone/reminder-call.sh;is set, but still giving error php "No such file or directory"ls -l /home/www/html/sip-phone/reminder-call.shto see if your command has been applied to it?-rwxrwxrwx 1 root root 142 Feb 22 10:19 /home/www/html/sip-phone/reminder-call.sh