[RESOLVED] PHP CLI and Cron

Author Message

Robin Muilwijk

Tuesday 29 December 2009 11:22:15 pm

Hi all,

I'm looking for some confirmation. I am checking on getting myself a hosting package and domain again. There is a very good shared host with which I've had good experience with in the past.

Now for the question; I've checked on the requirements page, everything is met except for PHP CLI. Do I really need that? I also checked, the server/php is not running in CGI mode. The package also has Cron available through DirectAdmin.

Would the above be enough to run eZ Publish/Flow and use all of it's features?

Thanks and regards, Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Robin Muilwijk

Thursday 31 December 2009 1:46:12 am

I think I get the picture with CLI, I was able to install eZ but when trying to setup crons I get:

(I run the following in cron; /usr/local/bin/php /home/****/domains/****/public_html/runcronjobs.php)

Warning: require_once(access.php): failed to open stream: No such file or directory in /home/****/domains/****/public_html/kernel/classes/ezscript.php on line 70  Fatal error: require_once(): Failed opening required 'access.php' (include_path='.:/usr/local/lib/php') in /home/****/domains/****/public_html/kernel/classes/ezscript.php on line 

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Jérôme Vieilledent

Wednesday 06 January 2010 4:20:01 am

Hi Robin

You need to change your working directory before launching any eZ script :

$ cd /home/****/domains/****/public_html
$ /usr/local/bin/php runcronjobs.php

Robin Muilwijk

Wednesday 06 January 2010 10:55:34 am

Hi Jérôme,

Thanks for the reply, I was struggling a bit with the exact command to put in the cron job. I'll try this one and report back with my results.

Do you have any idea/answer to my first question, about PHP CLI? Related to a shared hosting and the eZ requirements.

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Jérôme Vieilledent

Wednesday 06 January 2010 1:49:34 pm

Are you sure you don't have PHP CLI ? What does a php -v do ?

You were able to run runcronjobs.php once, so you certainly have PHP CLI... :)

Besides, it is needed for maintenance scripts... So if you don't run them, you won't have workflow/notification/link check/delayed indexing...

rek kremlin

Wednesday 06 January 2010 5:07:48 pm

"

Hi Robin

You need to change your working directory before launching any eZ script :

$ cd /home/****/domains/****/public_html
$ /usr/local/bin/php runcronjobs.php
"

Hi Vieilledent,

Can you explain more clearly this to me? Why should i change the working direction before run eZ script? Thanks for your support.

[url=http://www.practicebuildingcenter...ing_Chiropractic_Video_Episode58.cfm]marketing chiropractic[/url]
[url=http://www.blogtalkradio.com/bencummings]chiropractic marketing[/url]
[url=http://toymodeltrains-secrets.org/toy-model-trains/]Toy Model Trains[/url]

Jérôme Vieilledent

Thursday 07 January 2010 12:17:09 am

Hi Rek (my firstname is Jérôme ;))

This is needed because it is required by eZ Publish to launch eZ scripts (mainly php). Indeed, if you look at bootstrap code (like autoload.php), you'll notice include and require statements which are relative to eZ Publish instance root.

That's why you can find this in ezpublish.cron file :

# This must be set to the directory where eZ Publish is installed.
EZPUBLISHROOT=/path/to/the/ez/publish/directory

# Location of the PHP Command Line Interface binary.
PHP=/usr/local/bin/php

# Instruct cron to run the main set of cronjobs
# at 6:35am every day
35 6 * * * cd $EZPUBLISHROOT && $PHP runcronjobs.php -q 2>&1

# Instruct cron to run the "infrequent" set of cronjobs
# at 5:20am every Monday
20 5 * * 1 cd $EZPUBLISHROOT && $PHP runcronjobs.php -q infrequent 2>&1

# Instruct cron to run the "frequent" set of cronjobs
# every 15 minutes
0,15,30,45 * * * * cd $EZPUBLISHROOT && $PHP runcronjobs.php -q frequent 2>&1<font class="Apple-style-span" face="Arial, Helvetica, sans-serif" size="3"><span class="Apple-style-span" style="white-space: normal; " mce_fixed="1"><font class="Apple-style-span" face="monospace, Helvetica, sans-serif" size="3"><span class="Apple-style-span" style="white-space: pre; " mce_fixed="1">
</span></font></span></font>

Robin Muilwijk

Thursday 07 January 2010 12:20:08 am

Hi Jérôme,

It is a shared host, all I have access to is DirectAdmin (server controle panel) and on that access to setup cron jobs. No shell access I'm afraid. The runcronjobs.php was run through such a cronjob, not manually by command(line).

Does this mean the shared host won't meet the requirements?

Thanks for your effort and time, Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Jérôme Vieilledent

Thursday 07 January 2010 1:12:40 am

"

Hi Jérôme,

It is a shared host, all I have access to is DirectAdmin (server controle panel) and on that access to setup cron jobs. No shell access I'm afraid. The runcronjobs.php was run through such a cronjob, not manually by command(line).

Does this mean the shared host won't meet the requirements?

Thanks for your effort and time, Robin

"

Hi Robin

I understand. Try to run this via crontab :

cd /home/****/domains/****/public_html && /usr/local/bin/php runcronjobs.php

If it works, then you can add the content of ezpublish.cron to the crontab (first tune $EZPUBLISHROOT and $PHP variables ;))

Robin Muilwijk

Thursday 07 January 2010 1:32:44 am

Thanks,

I'll try that today, didn't get it to work yesterday. So in conclusion, if those cronjobs work, there is no need for a real command line e.g. shell access? And thus the shared host will be fine to run eZ on?

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Jérôme Vieilledent

Thursday 07 January 2010 2:14:37 am

Yep :)

If this doesn't work, you should try another web hosting, such as OVH (french but available in several languages). They have great shared hosting offers (with SSH access) and really cheap dedicated servers ;)

Robin Muilwijk

Thursday 07 January 2010 1:17:40 pm

Hi Jérôme,

I've got the cronjobs working, it was the last command you posted here that did the trick, thanks again for your time and support. I'll be looking into suitable hosting now, either the local company or the one you suggested (OHV).

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Jérôme Vieilledent

Friday 08 January 2010 1:31:18 am

Always a pleasure :)

Can you please flag the topic as resolved ? Thanks

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.