Forums / Install & configuration / Work Arrounds for Using Ez Publish with PHP CGI

Work Arrounds for Using Ez Publish with PHP CGI

Author Message

Ron Haines

Wednesday 16 March 2011 3:08:05 pm

I am writing this in hopes it will help those of you who are having troubles using eZ Publish with PHP CGI setups.

I am not going into a great deal of detail but here is my solution.

  1. I created the follow .htaccess file...

    <FilesMatch "(^index\.php|favicon\.ico|index_treemenu\.php|\.(gif|jpe?g?|png|css|js|swf|html?)|var(.+)storage.pdf(.+)\.pdf|(\/z.+\.php))$">
    order allow,deny
    allow from all
    </FilesMatch>

    RewriteEngine On
    RewriteRule content/treemenu/? index_treemenu.php
    RewriteRule ^index_treemenu\.php - [L]
    RewriteRule ^favicon\.ico - [L]
    RewriteRule !(\.(gif|jpe?g?|png|css|js|swf|html?)|var(.+)storage.pdf(.+)\.pdf|(\/z.+\.php))$ index.php?/
    DirectoryIndex index.php

  2. I ran my cron scripts by setting up my crontab with the following lines...

    cd /home/strato10/public_html/ && /usr/bin/php-cli /home/strato10/public_html/runcronjobs.php frequent
    cd /home/strato10/public_html/ && /usr/bin/php-cli /home/strato10/public_html/runcronjobs.php infrequent
    cd /home/strato10/public_html/ && /usr/bin/php-cli /home/strato10/public_html/runcronjobs.php

  3. NOTE THE IMPORTANT PART OF THE CRONTAB

    /usr/bin/php-cli

    This calls the CLI version of PHP as opposed to just PHP which runs the default and in our case the CGI version.

Finally I would like to say THIS Solution was setup according to my needs and may or may not work for you. If it does, I am glad I could be of help and if it doesn't, I am sorry but I do not have the time to get into lengthy discussions on working out custom solutions for other systems.

Good Luck and please post a comment and let us know if it works for you, Others may find if useful.

The past is past and cannot be changed, while the future is shaped by action taken in the present.

Ron Haines

Wednesday 16 March 2011 3:12:00 pm

This issue is self resolved.

The past is past and cannot be changed, while the future is shaped by action taken in the present.

Ron Haines

Wednesday 16 March 2011 3:14:19 pm

PS: This issue was self resolved.

The past is past and cannot be changed, while the future is shaped by action taken in the present.

André R.

Wednesday 27 April 2011 1:57:24 am

Since this thread pops up every month w/o links to prior threads: This should afik not be needed on 4.5/4.2011 and higher as cgi support is native now.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Ron Haines

Wednesday 27 April 2011 1:41:46 pm

I agree with you Andre, it is a moot poin on newer versions of EZP, but oour situation stemmed from our having our 2 enterprise sites, www.stratospherehotel.com and www.aquariuscasinoresort.com running on EZP 4.3
When we migrated our sites to new servers in Feb was when all the glitches I have been dealing with rared up and gave us headaches.
Corporate was concerned that trying an upgrade might only make things worse (should something go wrong) and so we opted for patching 4.3 to deal with the bugs that Ez now says are fixed in 4.5

I posted our solutions here so that those in similar situations, where upgrading might not be an option, could find reference to solutions that might work for them also.

But, you are correct and I should have pointed out that this and other work arounds I have posted are for EZP 4.3

PS: since the 4.3 bugs were fixed it has performed flawlessly as you can see by visiting the above mentioned sites.
Given the popularity of these two Las Vegas and Laughlin Nevada casinos, feel free to use them of examples of EZPs ability to be used in commercial websites.

Thanks for the reply.

The past is past and cannot be changed, while the future is shaped by action taken in the present.