Hi everyone,
I am having 2 php file to run with cron job, the first to run every hour and the second to run every 12pm midnight. I am using cPanel and this is the cron job.

i put this in the command to run tex field of the advance mode

***** /usr/local/bin/php -f /home/*****/public_html/ad/view.php

and this was the message i got on my mail.

Warning: require_once(../usr/local/bin/php/db/francis.php): failed to open stream: No such file or directory in /home/*****/public_html/ad/view.php on line 1

Fatal error: require_once(): Failed opening required '../usr/local/bin/php/db/francis.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*****/public_html/ad/view.php on line 1

can anyone help i am new to cron job.

Recommended Answers

All 11 Replies

Remove the .. in front of /usr

I do that all the time but should be as follows:

php /home/[B]*****[/B]/public_html/ad/view.php

I am so! sorry for saying help on this forum, am new as i go i promise to get better, Well thanks for that reply,
I just cant understand what you mean by those +++++ stuff you wrote there.

Those weard bolded symbols between the slashes is your cpanel login username. For example exampcom

Remove the .. in front of /usr

I am so! sorry for saying help on this forum, am new, as i go i promise to get better, Well thanks for that reply,
I just cant understand what you mean by those mean

GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+

Those weard bolded symbols between the slashes is your cpanel login username. For example exampcom

I said i am new to cron job, please kindly explain futher step by step on how i can use it.

Well first lets keep in mind the following command:

php /home/[B]????????[/B]/public_html/ad/view.php

Now where the question marks are you need to place in your cpanel username. So if for example to log into your admin you go to www.yoursite.com/cpanel then the username you place in that login box is what goes into the place of those question marks.

Those weard bolded symbols between the slashes is your cpanel login username. For example exampcom

Thanks for your answers, it seems my cron job its running but i am not really sure,
I want to know the kind of email i will recieve, so as to know that the page in question its running?
becourse at the moment right now i am not getting any error message, just that the mail i recieved was the full code of my page, with the exception of the 'php code' and 'mysql query' simillar to when a script page runs on the browser we only see the 'html'

does this means that my page is now running?

I was expecting a message like:
view.php runs at 1:00am or so, pls pardon me if i am writing Gabage

tell me how the response message looks like?

Well yes when receiving emails for what happened or output during a cron job via email, it is expected that html code will be displayed as plain text in the email. Also if you received an email about the cron job at the time you wish the success your complete. If however you did not receive an email there is a possibility that you needed to fill in the email field in simple mode of cron jobs section of the cpanel which by the looks of it you've already done.

Well yes when receiving emails for what happened or output during a cron job via email, it is expected that html code will be displayed as plain text in the email. Also if you received an email about the cron job at the time you wish the success your complete. If however you did not receive an email there is a possibility that you needed to fill in the email field in simple mode of cron jobs section of the cpanel which by the looks of it you've already done.

That was wonderful, thanks so much for your assistance, i checked the response i needed when the page runs, it was ok, exactly the way i want it,
This was what i use and it works well,

php -f /home/????????/public_html/ad/view.php

any newbie like me on cron job can always use this.

but i figure out that it varies in different host or cPanal. well thanks so much, you've been wonderful.

Well yes when receiving emails for what happened or output during a cron job via email, it is expected that html code will be displayed as plain text in the email. Also if you received an email about the cron job at the time you wish the success your complete. If however you did not receive an email there is a possibility that you needed to fill in the email field in simple mode of cron jobs section of the cpanel which by the looks of it you've already done.

That was wonderful, thanks so much for your assistance, i checked the response i needed when the page runs, it was ok, exactly the way i want it,
This was what i use and it works well,

php -f /home/????????/public_html/ad/view.php

any newbie like me on cron job can always use this.

but i figure out that it varies in different host or cPanal. well thanks so much, you've been wonderful.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.