[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

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 18 2025 19:27:01
Script start
Timing: Jan 18 2025 19:27:01
Module start 'layout'
Timing: Jan 18 2025 19:27:01
Module start 'content'
Timing: Jan 18 2025 19:27:02
Module end 'content'
Timing: Jan 18 2025 19:27:02
Script end

Main resources:

Total runtime0.7010 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0139 589.1875152.6406
Module start 'layout' 0.01390.0029 741.828139.4766
Module start 'content' 0.01670.6824 781.3047496.7891
Module end 'content' 0.69920.0017 1,278.093812.1250
Script end 0.7009  1,290.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4687160.0002
Check MTime0.00140.1945160.0001
Mysql Total
Database connection0.00400.572510.0040
Mysqli_queries0.644992.0015520.0124
Looping result0.00050.0687500.0000
Template Total0.658393.920.3291
Template load0.00200.288420.0010
Template processing0.656293.614920.3281
Template load and register function0.00010.016310.0001
states
state_id_array0.00380.536410.0038
state_identifier_array0.00130.185520.0007
Override
Cache load0.00170.2366150.0001
Sytem overhead
Fetch class attribute can translate value0.00060.085910.0006
Fetch class attribute name0.00130.190530.0004
XML
Image XML parsing0.00050.071910.0005
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00080.1154150.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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