Posts Tagged cron

Use lynx to run php file in crontab manager

Today, I was trying to set a php script file in crontab on Godaddy Virtual Dedicated server. Crontab executing that PHP script with warning. Actually, its not including the files which I am including using ‘require_once()‘ function. I have used the relative path for all the included files and its not possible to me to give absolute path for all files which are included. So, to solve this problem I have used lynx.

LYNX – lynx is the command line browser which is available on almost all the Linux versions. For more detail click here.

Instead, of using this command

/usr/bin/php /html/abc/public_html/cron.php

I have used this command

/usr/bin/lynx -source http://www.mywebsite.com/cron.php

in crontab manager. So, what lynx did is Its opens my cron.php files when this cron job execute.

-source Outputs HTML source instead of formatted text. To see all the available options of lunx click here.

If you don’t know the path of lynx on your server you can use ”whereis lynx” command using SSH. It will give you path of lynx directory on your server.

, ,

No Comments