[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.