C'est un candidat pour remplacer PHP FastCGI.
Les fonctionnalités annoncées sont sympa :
-
Adaptive process spawning (NEW!)
- Basic statistics (ala Apache's mod_status) (NEW!)
- Advanced process management with graceful stop/start
- Ability to start workers with different uid/gid/chroot/environment and different php.ini (replaces safe_mode)
- Stdout & stderr logging
- Emergency restart in case of accidental opcode cache destruction
- Accelerated upload support
- Support for a "slowlog"
- Enhancements to FastCGI, such as fastcgi_finish_request() - a special function to finish request & flush all data while continuing to do something time-consuming (video converting, stats processing, etc.)
Stéphane
On Fri, Jul 23, 2010 at 11:09 PM, Nicolas Thouvenin <
nthou...@gmail.com> wrote:
>
> hello pkgi's users
>
> Je crois que j'ai trouvé un moyen de cracher votre demon fastcgi/php
>
> Constatez-vous le même problème ?
> Avez-vous une solution ?
>
> 1. Tout d'abord, il vous faut un petit script php, que l'on appellera "put.php"
> -------------- put.php ---------------------------8<---------------------------
> <?php
> echo 'OK';
> $handle = fopen("php://input", "rb");
> while (!feof($handle)) {
> fread($handle, 8192);
> }
> fclose($handle);
> ?>
> ------------------------------------------------------>8---------------------------
>
>
> 2. Ensuite 3 fichiers avec 3 tailles différentes : 255Mo, 256Mo & 257Mo
> Vous pouvez les obtenir via les commandes suivantes :
> dd if=/dev/zero of=255Mo.txt bs=1k count=261120
> dd if=/dev/zero of=256Mo.txt bs=1k count=262144
> dd if=/dev/zero of=257Mo.txt bs=1k count=263168
>
> 4. Puis une configuration php légèrement gonflée :
> --------------- php.ini ---------------------------8<---------------------------
> file_uploads = On
> memory_limit = 512M
> upload_max_filesize = 512M
> post_max_size = 512M
> ------------------------------------------------------>8---------------------------
>
>
> 3. Enfin, il vous suffit d'envoyer le fichier le plus gros au script php.
> pour obtenir une erreur 500 Internal Error
>
> Je crois même que le crash est reproductible avec une configuration
> par défaut et des fichiers autour de 8Mo + ou - quelques octets
>
>
> 4. Résultats
>
> ------ 255Mo ------------
> $ curl
http://127.0.0.1:8000/put.php --data-binary @./255M.txt
> OK
>
> ------ 256Mo ------------
> $ curl
http://127.0.0.1:8000/put.php --data-binary @./256M.txt
> <br />
> <font size='1'><table dir='ltr' border='1' cellspacing='0' cellpadding='1'>
> <tr><th align='left' bgcolor='#f57900' colspan="5"><span
> style='background-color: #cc0000; color: #fce94f; font-size:
> x-large;'>( ! )</span> Fatal error: Allowed memory size of 536870912
> bytes exhausted (tried to allocate 268435457 bytes) in Unknown on line
> <i>0</i></th></tr>
>
>
>
> ------ 257Mo ------------
> $ curl
http://127.0.0.1:8000/put.php --data-binary @./257M.txt
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>500 Internal Server Error</title>
> </head><body>
> <h1>Internal Server Error</h1>
> <p>The server encountered an internal error or
> misconfiguration and was unable to complete
> your request.</p>
> <p>Please contact the server administrator,
> and inform them of the time the error occurred,
> and anything you might have done that may have
> caused the error.</p>
> <p>More information about this error may be available
> in the server error log.</p>
> <hr>
> <address>Apache/2.2.12 (Ubuntu) Server at 127.0.0.1 Port 8000</address>
> </body></html>
>
>
>
> Annexes :
>
> les logs
>
> ------ 255Mo ------------
> [Fri Jul 23 16:47:02 2010] [info] mod_fcgid: server
> /home/thouveni/applis/userapp/usr/lib/fcgi-bin/php-fcgi-wrapper(21344)
> started
>
>
> ------ 256Mo ------------
> [23-Jul-2010 16:47:17] PHP Fatal error: Allowed memory size of
> 536870912 bytes exhausted (tried to allocate 268435457 bytes) in
> Unknown on line 0
>
> ------ 257Mo ------------
> [Fri Jul 23 16:47:26 2010] [notice] mod_fcgid: process
> /home/thouveni/applis/userapp/usr/lib/fcgi-bin/php-fcgi-wrapper(21344)
> exit(normal exit), terminated by calling exit(), return code: 255
> [Fri Jul 23 16:47:26 2010] [warn] mod_fcgid: cleanup zombie process 21344
> [Fri Jul 23 16:47:30 2010] [info] mod_fcgid: server
> /home/thouveni/applis/userapp/usr/lib/fcgi-bin/php-fcgi-wrapper(21352)
> started
> [Fri Jul 23 16:47:31 2010] [warn] (104)Connection reset by peer:
> mod_fcgid: read data from fastcgi server error.
> [Fri Jul 23 16:47:31 2010] [error] [client 127.0.0.1] Premature end of
> script headers: php-fcgi-wrapper
> [Fri Jul 23 16:47:36 2010] [notice] mod_fcgid: process
> /home/thouveni/applis/userapp/usr/lib/fcgi-bin/php-fcgi-wrapper(21352)
> exit(communication error), get unexpected signal 11