php - Initialize WordPress environment in a script to be run by a cron job -
i have run custom php script want run cron job. within script, need wordpress functions insert users wordpress table. script on root directory of wordpress installation. script starting with:
require( dirname( __file__ ) . '/wp-load.php' );
if run script directly in browser functions , else works no errors. when cron hits apparently not work. nothing supposed happen happens.
just if helps, command line is:
php -q /home/enkaizene/public_html/soporte/cron-test.php
is issue script? or command? how should script start?
thank you
you run cron using wget web address.
wget -o /dev/null http://www.example.com/cron-test.php
you limited php timeout need make sure script doesn't run longer set timeout - or increase timeout.
Comments
Post a Comment