Share » Forums » General » Running eZ publish scripts via the...

Running eZ publish scripts via the command line

Running eZ publish scripts via the command line

Monday 09 May 2005 7:04:08 am - 7 replies

Modified on Monday 09 May 2005 7:37:11 am by kracker (the)

Author Message

Marat M.

Monday 09 May 2005 8:06:38 am

hi, kracker,

I've downloaded the file from here

http://ezpub.co.uk/files/fixes

Then unpacked it into

http:[mysite]/ez_directory/bin/linux 

and named "php-cli".

What I didn't understand is "Call your eZ publish runcronjobs.php like this, to test these instructions"

What should I use to call? Command line? I thought that CMD is used to call local files. But my site is on a shared hosting...

kracker (the)

The Doctor

Monday 09 May 2005 8:42:21 am

Maret,

You almost have it, keep trying!

To run the script: runcronjobs.php

You must run this command (below) inside of a command line window (also called ssh):

./bin/linux/php-cli runcronjobs.php

Testing this way <b>requires</b> ssh access to your shared hosting provider.

Honestly if your shared hosting provider does not provide ssh access to the server your being ripped off and should seek a replacement hosting provider.

I would recommend choosing one from the list of eZ publish Hosting Partners:

http://www.ez.no/partner/partner_list/(partner)/hosting/(sort)

Alternately,

Ask your provider just how you can use cron or crontab on your shared hosting provider (perhaps via a control panel of some kind)

cheers,
//kracker

Sage Francis : Bounce - Live at the Met Cafe

<i>Disclaimer: I have an interest in seeing you acquire improved hosting service ... I know better.</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Marat M.

Monday 09 May 2005 10:43:34 am

Thanks, cracker. I will try to use some of the hostings you offer that is primarily intended for eZPublish usage.

Still I'm learning the features of eZPublish and it seems I have all that is necessary to run my site. However, there is one small though interesting question I posted here

http://ez.no/community/forum/general/a_policy_for_a_separate_content_object

Best,
Marat

Marat M.

Monday 09 May 2005 11:01:57 am

BTW, I asked my hosting provider, and this is what they answered:

"Our hosting is on windows machines so we suggest another solution for scheduled scripts execution. You can place one of these files into the root directory of your site:

_cron01.php - every minutute
_cron60.php - every hour
_cron1440.php - every 24 hours

And they will be executed as specified."

So, my only lame question is - what to write into those files :))

Thanks in advance,
Marat

kracker (the)

The Doctor

Tuesday 10 May 2005 12:42:21 am

Well,

I don't develop using windows so it is harder for me to answer with certainty. Judging by the silence in my absence I gather that not many advanced eZ publish developers do either ...

In fact I believe that eZ systems only recommends hosting eZ publish applications on GNU/Linux servers.

Still, I started this so I should end it.

I found these links which talk in great detail about php-cli:
<i>http://book.itzero.com/read/others/0503/Prentice.Hall.PTR.PHP.5.Power.Programming.Oct.2004.eBook-LiB_html/013147149X/ch16lev1sec2.html</i>

As well as this document talking about finding the php-cli windows (binary) application in a windows server.

<i>http://www.zend.com/manual/install.windows.manual.php
http://www.zend.com/manual/install.windows.building.php</i>

As for your cron I would write a php script to call the cronjob (the windows way) inside a php script using the php-cli binary provided by your hosting provider's php installation (assuming they provide php-cli), then rename this custom script, to the frequency you wish to have it run.

_cron60.php

Upon even further review, I have found this bug which talks about custom installing the missing php-cli application on windows: <i>http://www.ez.no/community/bugs/runcronjobs_php_fails_with_windows_downloadable_package</i>

Per the above suggestions in the (above) bug, I have packaged the 'Windows : php (cli) v4.3.11' Binary for users of windows to get/use quickly and simply.

<i>http://download.ezpublishhosting.com/php-cli/windows/php-cli.zip</i>

Best Wishes,

//kracker

<i>Quincy Jones : Ironside (Excerpt)
The 5.6.7.8's : Woo Hoo
Zamfir : The Lonely Shepherd
</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

kracker (the)

The Doctor

Tuesday 10 May 2005 1:46:57 am

I've also gone ahead and written a wrapper script which you should be able to use in your specific situation as a drop in solution.

// #!c:\php\php.exe -q
/*
 Author: kracker
 Date: 05/09/2005
 License: GNU GPL (v2 or later)
 Description: Windows php script wrapper to call eZ publish : runcronjobs

 This (albeit little script) is expressly provided only
 under the terms of the GNU GPL. Just so we are clear :)
*/

system("cd /web/the-path-to-ez/; c:\php\cli\php.exe /web/the-path-to-ez/runcronjobs.php");

//exit();

As for your cron I would write the above into a php script file named ...

_cron60.php

I can't test this code but from my collected experiances ( I was young, I didn't know any better ...) this should work without modifications.

I only would make sure the file's permissions are set to allow this to be an executable file? I'm not certain how they handle that in windows perhaps it's a non-issue. Testing / Bug reports welcome (just post it to this thread).

<i>Everyone, sing with me ...</i>

Cheers,
//kracker

<i>Sole : Live from Rome : Crisis</i>
<i>Sole : Live from Rome : Every Single One of Us</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Marat M.

Tuesday 10 May 2005 4:39:02 am

You know, I more and more incline to use eZPublish powered hosting instead of ordinary hosting. Even if I correctly make all the adjustments there is no guarantee that something will not work properly in future. So I will choose from the eZpublish hosting providers.

Thanks for you help,

- Marat

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu