. .
pragmaMx Support Forum 25 Mai 2012, 21:44:22 *
Willkommen Gast. Bitte einloggen oder registrieren.


Einloggen mit Benutzername und Passwort
News:
Brauchen Sie Hilfe? Bitte nutzen Sie unsere Suchfunktion bevor Sie Beiträge oder Fragen ins Board schreiben! Viele Fragen wurden bereits gestellt und beantwortet. Danke!
 
Übersicht Hilfe Forenregeln / Boardrules
 
Suche
Seiten: 1 [2]  Alle   Nach unten
Drucken
Autor Thema: [Solved] PragmaMX 1.1.11 too slow than 1.1.10 - Langsam problem  (Gelesen 6894 mal)
0 Mitglieder und 2 Gäste betrachten dieses Thema.
algebre
weiss was
***
Offline Offline

Geschlecht: Männlich
Beiträge: 155

algebre


WWW
« Antworten #20 am: 15 Oktober 2010, 20:11:55 »

About the file "obstart.php" nothing special, it's a simple test that determines the nature of the account "Gold, premium or free" to view ads or not.
for the second file, I could not see, because it is owned by root and chmod 600.
a sample from the file "obsatrt.php":
Code: [Select]  
$pro = $rest->pro;
$vip = $rest->vip;
$suspendu = $rest->suspendu;   

// si vip = 1, on affiche pas la pub.
if($vip=='1')
{ $pub='0'; }

// si le compte est en gold, on checke la date
if($pro=='1')
{
// on regarde si la date est ok ou non
$jour = substr($date,0 , 2);
$mois = substr($date,3 , 2);
$annee = substr($date,6 , 4);

$expire = mktime('0','0','0',$mois, $jour, $annee, '-1');
$date_actuelle = time();
if($date_actuelle < $expire) {
    $pub = 0;
}
else
{ $pub='1'; }
}

// si le compte n'est pas gold, on affiche la pub
if($pro=='0')
{ $pub='1'; }

// si le compte est suspendu, on le d?gage
if($suspendu=='1')
{
header("location: http://www.freeheberg.com/suspendu.html");
}

// on r?cup?re les valeurs

if($pub=='1')
{

#$piece1='<div style="display: none;">';
#$piece2='</div>';
#$ListeChiffre = fopen("http://partenaires.greatsong.net/zik/free_great.php?id=$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]","r");
#$df = fgets($ListeChiffre, 1000);
#fclose($ListeChiffre);

$tagpub="<script type=\"text/javascript\" src=\"http://78.41.233.99/~fhv3/slidein.php\"></script>
";
$tagpub2="
<!-- Tag Publicitaire Freeheberg.com -->
<script type=\"text/javascript\" src=\"http://www.veoxa.com/get_trackingcode.php?aid=63&linkid=O31&type=jscript&r=\" + document.referrer></script>
<script type=\"text/javascript\" src=\"http://www.veoxa.com/get_trackingcode.php?aid=63&sid=59&linkid=O592&type=jscript\"></script>
</body>
</html>
<!-- Pour une validation w3c, ne rajoutez pas les balises body et html a votre page. -->
<!-- FIN TAG PUBLICITAIRE -->";

}

// si la pub doit ?tre ? 0, on remet bien tout ? 0
if($pub=='0')
{
$tagpub='';
$tagpub2='';
}
In any case the problem is not there.

I replaced this code :
Code: [Select]  
/* alle eventuelle Ausgaben verwerfen */
        while (ob_get_level()) {
            ob_end_clean();
        }

by this:
Code: [Select]  
/* alle eventuelle Ausgaben verwerfen */
        $buffer_level = ob_get_level();

        while (ob_get_level() > $buffer_level) {
            ob_end_clean();
        }
error_log($buffer_level , 3, $this->pmxroot . 'dynadata' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'erreurs.log');
And with "firefox" the level is 2 "in the generated file
Whatever the number of levels, the server sends an error on line 155
The server crashes on this iteration, if we put a break or delete "while" the function __destruct () will not work properly
I tried with theme-cache enabled and disabled, same result.
all this concerns only firefox & IE
everything is normal for opera.




I know I should write in the section dedicated to pmx0.1.12.
but I do not know German
Gespeichert
Andi
Administrator
******
Offline Offline

Geschlecht: Männlich
Beiträge: 19.424

Andi


WWW
« Antworten #21 am: 17 Oktober 2010, 19:15:08 »

Hi,  Smiley

Please excuse my late reply.

Algebre has found the problem already.

My solution would be as follows:
Code: [Select]  
        /* alle eventuelle Ausgaben verwerfen */
        for ($i = 1; ($i <= 10 && ob_get_contents()); $i++) {
            ob_end_clean();
        }

The only purpose of this action is to remove any content from the output buffer. The level does not matter.
For safety, a counter is included that prevents an infinite loop.
Gespeichert

schön´s Grüssle, Andi
Kein Support über PN, Mail oder ICQ!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!
algebre
weiss was
***
Offline Offline

Geschlecht: Männlich
Beiträge: 155

algebre


WWW
« Antworten #22 am: 17 Oktober 2010, 22:00:27 »

hi
I noticed that problem is related to "zlib.output_compression = On" in php.ini.
with "Off" everything is ok. You can try it ..
With both solutions "break & for", the server sends to  the browser a file with extension "gz". but the theme is deformed (tested with firefox 3.6)


I tried with "ini_set('zlib.output_compression', 'Off');"  in the top of the file "default.css.php".
but  not work
Gespeichert
Andi
Administrator
******
Offline Offline

Geschlecht: Männlich
Beiträge: 19.424

Andi


WWW
« Antworten #23 am: 19 Oktober 2010, 14:58:53 »

Hi Smiley

we have two problems...

1.) infinite loop => solved

2.) double encoded css-output.
I think there is a bug in method compress_output() in the default.css.php and i'm just looking at the error...

try this: http://web-sniffer.net/
and check this url http://ns12.freeheberg.com/~shortym2/layout/style/default.css.php
and compare with http://www.pragmamx.org/layout/style/default.css.php
When you have not selected the option "Accept-Encoding: gzip", all is ok...

Gespeichert

schön´s Grüssle, Andi
Kein Support über PN, Mail oder ICQ!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!
Andi
Administrator
******
Offline Offline

Geschlecht: Männlich
Beiträge: 19.424

Andi


WWW
« Antworten #24 am: 19 Oktober 2010, 20:12:25 »

Hi Smiley

ok, in default.css.php is no check for zlib.output_compression off/on.
If the browser sends the 'Accept-Encoding' header to compress the data, the data are compressed twice...

The solution is, to check if zlib.output_compression is on in php.ini and if it's true, dont compress the data twice.
Add two lines in the case construct in function compress_output():
Code: [Select]  
           case !function_exists('gzcompress'):
            case ini_get('zlib.output_compression'):

Here ist the complete new function in pragmaMx 1.12 RC1:
Code: [Select]  
   private function compress_output($contents, $level = 0)
    {
        /* versuchen zu zippen? */
        $encoding = (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '';
        $size = strlen($contents);
        switch (true) {
            case !$level:
            case $size < 2048:
            case headers_sent():
            case !function_exists('gzcompress'):
            case ini_get('zlib.output_compression'):
            case ini_get('output_handler') == 'ob_gzhandler':
                return $contents;
                break;
            case $encoding && strpos($encoding, 'x-gzip') !== false:
                header('Content-Encoding: x-gzip');
                break;
            case $encoding && strpos($encoding, 'gzip') !== false:
                header('Content-Encoding: gzip');
                break;
            default:
                return $contents;
        }
        $crc = crc32($contents);
        $out = "\x1f\x8b\x08\x00\x00\x00\x00\x00";
        $out .= substr(gzcompress($contents, $level), 0, - 4);
        $out .= pack("V", $crc) . pack("V", $size);
        return $out;
    }

changed files for pragmaMx 0.1.11 and pragmaMx 1.12 RC1 nearby...


@ algebre
Thanks for your great support

@ shorty
your installation at http://ns12.freeheberg.com/~shortym2/ works fine, now...

[gelöscht durch Administrator]

[gelöscht durch Administrator]
Gespeichert

schön´s Grüssle, Andi
Kein Support über PN, Mail oder ICQ!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!
algebre
weiss was
***
Offline Offline

Geschlecht: Männlich
Beiträge: 155

algebre


WWW
« Antworten #25 am: 19 Oktober 2010, 20:25:59 »

Hi
Uploaded => tested => OK
http://ns12.freeheberg.com/~shortym2/layout/style/default.css.php
now this site and all sites with "zlib.output_compression" enabled work fine
http://ns12.freeheberg.com/~shortym2/

@shorty
Now you can upgrade to pragmaMx 0.1.11 without problem.
Gespeichert
shorty
weiss was
***
Offline Offline

Beiträge: 103


WWW
« Antworten #26 am: 20 Oktober 2010, 17:06:37 »

 Thanks very much for your support !   thumbup
Long life for PragmaMX ! Hope i will use it for ever !   drinks
Gespeichert

Seiten: 1 [2]  Alle   Nach oben
Drucken
 
Gehe zu:  

Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
design by hENNE, layout based on YAML