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.

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

eZ debug

Timing: Jan 29 2025 23:47:18
Script start
Timing: Jan 29 2025 23:47:18
Module start 'layout'
Timing: Jan 29 2025 23:47:18
Module start 'content'
Timing: Jan 29 2025 23:47:18
Module end 'content'
Timing: Jan 29 2025 23:47:18
Script end

Main resources:

Total runtime0.0158 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.3828151.2422
Module start 'layout' 0.00650.0023 739.625036.7188
Module start 'content' 0.00880.0050 776.343898.8281
Module end 'content' 0.01380.0020 875.171937.9766
Script end 0.0157  913.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002314.6636140.0002
Check MTime0.00116.8443140.0001
Mysql Total
Database connection0.00095.985810.0009
Mysqli_queries0.003723.463930.0012
Looping result0.00000.083110.0000
Template Total0.001610.210.0016
Template load0.00149.066310.0014
Template processing0.00021.065610.0002
Override
Cache load0.00063.568810.0006
General
dbfile0.00148.889580.0002
String conversion0.00000.051440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs