Forums / Install & configuration / [ez4]How to make staticcache in mode CGI ???

[ez4]How to make staticcache in mode CGI ???

Author Message

Bin LIU

Friday 19 September 2008 3:11:16 am

Hi,

I have a space in 1and1, I can do SSH and cron with it. but the PHP works in mode CGI.

My site http://fr.lingping.info is long ! So I want to user static cache, but it doesn't work in CGI mode.

I found some info in this forum and i changed the kernel/classes/ezscript.php
And then, when I excute the script PHP, no error, but not work.

Someone has some experience ??? thanks

That's what i changed in the kernel/classes/ezscript.php

      if ( php_sapi_name() != 'cli' )
        {
            eZDebug::writeNotice( "PHP is currently using the '" . php_sapi_name() . "' interface. Make sure it is using the 'cli' interface.", "PHP Setup");

            // Preparing CGI and let it execute with preset values as the cli
            // http://de.php.net/manual/en/features.commandline.php

            // Fix memory limit
            $memLimit = ini_get( 'memory_limit' );
            if ($memLimit != '')
            {
                switch ( $memLimit{strlen( $memLimit ) - 1} )
                {
                    case 'G':
                        $memLimit *= 1024;
                    case 'M':
                        $memLimit *= 1024;
                    case 'K':
                        $memLimit *= 1024;
                }
                if ( $memLimit != -1 && $memLimit < 44040192 ) /* 42*1024*1024 */
                {
                    @ini_set( 'memory_limit', '42M' );
                }
            }

            // Handle output buffering
            @ob_end_flush();
            ob_implicit_flush( TRUE );

            // PHP ini settings
            set_time_limit( 0 );
            ini_set( 'track_errors', TRUE );
            ini_set( 'html_errors', FALSE );
            ini_set( 'magic_quotes_runtime', FALSE );

            // Define stream constants
            define( 'STDIN', fopen( 'php://stdin', 'r' ) );
            define( 'STDOUT', fopen( 'php://stdout', 'w' ) );
            define( 'STDERR', fopen( 'php://stderr', 'w' ) );

            // Close the streams on script termination
            register_shutdown_function( create_function( '', 'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;' ) );
        }

       
        //include_once( "lib/ezutils/classes/ezini.php" );
        $ini = eZINI::instance();
        $phpLocale = trim( $ini->variable( 'RegionalSettings', 'SystemLocale' ) );
        if ( $phpLocale != '' )
        {
            setlocale( LC_ALL, explode( ',', $phpLocale ) );
        }

        // Set correct site timezone
        $timezone = $ini->variable( "TimeZoneSettings", "TimeZone" );
        if ( $timezone )
        {
            putenv( "TZ=$timezone" );
        }
    }

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

Bin LIU

Friday 03 October 2008 6:38:29 am

anybody ? an idea ? Thanks.

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

eZ debug

Timing: Jan 19 2025 02:23:39
Script start
Timing: Jan 19 2025 02:23:40
Module start 'content'
Timing: Jan 19 2025 02:23:41
Module end 'content'
Timing: Jan 19 2025 02:23:41
Script end

Main resources:

Total runtime1.1488 sec
Peak memory usage4,096.0000 KB
Database Queries189

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.0938180.8203
Module start 'content' 0.00611.0247 769.9141501.8828
Module end 'content' 1.03080.1179 1,271.7969337.0469
Script end 1.1487  1,608.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3150210.0002
Check MTime0.00130.1172210.0001
Mysql Total
Database connection0.00060.055410.0006
Mysqli_queries1.085894.51341890.0057
Looping result0.00160.13851870.0000
Template Total1.117197.220.5585
Template load0.00210.178520.0010
Template processing1.115097.056720.5575
Template load and register function0.00010.007810.0001
states
state_id_array0.00110.096010.0011
state_identifier_array0.00130.109220.0006
Override
Cache load0.00170.1466150.0001
Sytem overhead
Fetch class attribute can translate value0.00160.140920.0008
Fetch class attribute name0.00090.075730.0003
XML
Image XML parsing0.00070.064020.0004
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00260.2225260.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs