• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Cron Probo

Dark_Element

New Member
It is my first times with cron jobs so i don't know too much about it but i guess that my problem is this:

The cron job points to a php file but it does not go through apache or the php intrepreter so it was never actually used, but insted tried to be interpreted as linux commands....

my question is what should i type in as the command to let the cron job load the page using apache?
 
First, let's assume the PHP file is php-cron.php

There are two possible solutions for PHP-cron jobs:
A.For PHP installed using Apache module (notice the syntax: AddModule, LoadModule, AddType.... while editing httpd.conf for the first time), you may do the following:

1.Install lynx (as server's web browser)
2.chmod php-cron.php to 0755
3.Add this line to your /etc/crontab
lynx -dump http://www.yoursite.com/php-cron.php
Important: use full URL (http://.....)
4.Start cron jobs
shell>>crontab crontab

B.For PHP installed as CGI (notice the syntax: AddHandler... while editing httpd.conf for the first time), you should do following:

1.Add this line at the first line of php-cron.php
#!/usr/local/bin/php -q
It's a perl syntax. The path #!/usr/local/bin/php points to the location of your executable PHP
2.chmod php-cron.php to 0755
3.Add this line to your /etc/crontab
php /absolute/path/to/php-cron.php
4.Start cron jobs
shell>>crontab crontab

May this help
 
Back
Top