When my crontab executes this script it's sending me an email with this output. I'm not sure what the problem is. This is the output that I'm receiving.
/bin/bash: /home/kingsms/public_html/cronsH.php: Permission denied
[]
When my crontab executes this script it's sending me an email with this output. I'm not sure what the problem is. This is the output that I'm receiving.
/bin/bash: /home/kingsms/public_html/cronsH.php: Permission denied
[]
Try making the file executable:
chmod +x /home/kingsms/public_html/cronsH.php
Bash is not the proper interpreter for your script. You'll need to execute it using PHP. The problem is that you'll need to know the location of your PHP interpreter. Most likely it's in one of these places.
/usr/bin/php
/usr/local/bin/php
You could also execute this in your cron and get the results.
/usr/bin/find / -name php -type f
This should give you all the locations of the php executable.
Most likely it's going to be /usr/bin/php so you'll change your crontab entry to be:
/usr/bin/php /home/kingsms/public_html/cronsH.php
I've got to say, having anything executable and world writable in your public_html directory is a very large security risk but that's for another post.
BTW, another alternative is to open your script and put the interpreter directive at the top of the script like this.
#!/usr/bin/php
<?php