Jump to content

cron job on cpanel


chriscloyd

Recommended Posts

public_html/test22/includes/delete_spam.php: line 1: ?php: No such file or directory
public_html/test22/includes/delete_spam.php: line 2: syntax error near unexpected token `"../db.php"'
public_html/test22/includes/delete_spam.php: line 2: `include("../db.php");'
Link to comment
https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142401
Share on other sites

For cronjobs - you need to specify full system paths. You also need to make sure that cron can run php. You might have to specify something like:

/usr/bin/php /home/user/public_html/file.php

You also need to make sure that permissions are correct on the file.

A last resort if the above doesnt work is to specify this command in cron:
/usr/bin/wget http://mywebsite.com/myfile.php

The above will definately work.

-steve
Link to comment
https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142415
Share on other sites

[code]/usr/bin/php /home/user/public_html/test22/includes/delete_spam.php[/code]

If thats what you have - it should work. I take it you have tried the above script on the server itself (via a system() ) or exec function, or better yet - when logged into the server (via ssh or ftp)??

If the above aint work - I would go the wget route.

-steve
Link to comment
https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142421
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.