By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,666 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,666 IT Pros & Developers. It's quick & easy.

create a cron job of php script using webmin

P: n/a
hi,

i m using webmin to create a cron job of a php script. While i click on
'run it now', it works, generate the output. However, the php script
doesnt execute for every minutes which i've set to.

besides the php scripts, i have other scripts run under cron jobs, such
as perl scripts and log files. I couldnt understand why my php scripts
doesnt work under cron job.

Is it the webmin or php problem?

Give me some ideas please!! really getting frustrated !! T_T

Aug 11 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Thu, 11 Aug 2005 02:19:50 -0700, volantecho wrote:
hi,

i m using webmin to create a cron job of a php script. While i click on
'run it now', it works, generate the output. However, the php script
doesnt execute for every minutes which i've set to.

besides the php scripts, i have other scripts run under cron jobs, such
as perl scripts and log files. I couldnt understand why my php scripts
doesnt work under cron job.

Is it the webmin or php problem?

Give me some ideas please!! really getting frustrated !! T_T


Cron jobs run with an extremely minimal environment. Practically, this
means that there's no PATH set up, so you either need to add in the
necessary directories in a PATH=... line at the top of your script ( which
also needs #!/bin/bash or equivalent as it's first line ), or all
applications are called using their absolute path. I normally use the
latter, but I really don't know why - it makes scripts a lot more
difficult to port!

Steve
Aug 11 '05 #2

P: n/a
Hi Steve,

First thanks for your response! I solved the prob :)
I havent put the full path of my php command, that caused the problem

i failed to make my cron job run when i write the command like this:
php -q /home/lain/public_html/cronjob.php

but this work!!
usr/bin/php -q /home/lain/public_html/cronjob.php

never thought to add the 'usr/bin' at front while on my another server
i'd never add them, but they works :D

Thanks again, Steve :)

Aug 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.