How Do Crons work??

Status
Not open for further replies.

eternal-empire

New Member
Messages
53
Reaction score
0
Points
0
I will be using crons. But how you you set them up??

What kind of command do you give it?? Command in what language?? Please tell me everything I need to know about crons

Thanks for your help
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
There is a cron section in cPanel, pick the beginner button. It does not have it's own language and whatever script you're using should tell you how to set it up.

-Corey
 

uptime2

New Member
Messages
4
Reaction score
0
Points
0
Can I ask what is the path to PHP? I'm on the intermediate php version and I tried several options suggested on the forum here to no avail (/usr/bin/php, php -q, php-adv-cron, etc.).
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
/usr/bin/php-cron
 
Last edited:

uptime2

New Member
Messages
4
Reaction score
0
Points
0
Hmm, doesn't seem to work. I have

/usr/bin/php-cron /home/uptime/public_html/path.php

as a test that calls mail(), but I see nothing.

Edit: Weird, it just started working just now. Thx!
 
Last edited:

eternal-empire

New Member
Messages
53
Reaction score
0
Points
0
As far as I have understood from the documentation. All I have to do is mention the filename and nothing else. Example:

/php/cronfiles/run.php

-------------------------

Will that work?? Or do I need a "-cron" or something after it??
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Try php-cron /home/user/public_html/run.php

Of course replacing the above with your user name and the location of the file.

-Corey
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Is that same for all the users. I'm in Advanced PHP Configuration, and just used
Code:
php /home/user/public_html/file.php
But, I do face some problems. The output states Memory Limit Exhausted (8MB Limit). How can I increase it.. Or, I have to use php-cron???
 
Last edited:

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Oops!!! I'm getting an error using "php-cron".

The output email has the following message. How to resolve this issue? Please help me.

Warning: include_once(./includes/bootstrap.inc): failed to open stream: No such file or directory in /home/myistop/public_html/cron.php on line 9

Warning: include_once(): Failed opening './includes/bootstrap.inc' for inclusion (include_path='.:/x10hosting/php2/lib/php') in /home/myistop/public_html/cron.php on line 9

Fatal error: Call to undefined function drupal_bootstrap() in /home/myistop/public_html/cron.php on line 10
Thanks in advance,
 

jpf190279

New Member
Messages
9
Reaction score
0
Points
0
Kajasweb it looks like you are trying to include files that php can't find, are you sure that they are located at that addres?

try

include_once('

either
../includes/bootstrap.inc
if the file is located in a previous directory tree branch or

or
include/bootstrap.inc
if it is located on the same branch of the tree but further down.


');

see what that does.

-J
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
i have changed to
Code:
../includes/bootstrap.inc
But still, I'm getting the same error message.

Also, I don't think Drupal coding is wrong. Just go through the error message again.. there is something related to include path. Is there any thing that PHP Configuration does in this issue ?

Corey has to help.. :-(
 

jpf190279

New Member
Messages
9
Reaction score
0
Points
0
Silly question but have you requested your account to be upgrades from basic php to intermediate? Includes are only available with intermediate setup.

Barring that, try seeing if you just include a basic php script from an area you know like

create file bob.php put bob in a folder called include in your root directory

in bob.php type

<?
function helloimbob()
{
echo "Hello I'm Bob";
}
?>

then save and close

then open a new file called test.php in the root directory, one below include, there type

<?
include('include/bob.php'); //Points to the file you want to include
helloimbob(); //call includes function
?>

save and close.

run test.php in the browser it should barring my sillyness show Bob!
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Not sure why it's not working like that, you can test what jpf190279 said if you want.

Also try using the full path to the file for example if your includes dir is in your public_html folder. Change the path to:
/home/myistop/public_html/includes/bootstrap.inc

-Corey
 
Status
Not open for further replies.
Top