Mon serveur fonctionne normalement dans la grande majorité des cas, sauf avec un script php plus lourd que les autres qui provoque un message "Connexion réinitialisée - la connexion avec le serveur a été réinitialisée pendant le chargement de la page". Je suppose qu'il s'agit d'un problème Apache. Peut-on le régler en donnant àApache plus de ressources et si oui comment ?
Windows vista, Apache 2.2.11, PHP 5.2.4, MySQL 5.0.45
J'ai démarré Wamp et appelé directement la page php qui crée le problème.
Le log Apache est très bavard (mais je ne sais pas comment l'interpéter :-( ; les logs php et mysql n'indiquent rien d'anormal.
Log Apache
[Sat Aug 01 11:34:08 2009] [warn] pid file C:/Wamp/bin/apache/Apache2.2.11/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Sat Aug 01 11:34:08 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.4 configured -- resuming normal operations [Sat Aug 01 11:34:08 2009] [notice] Server built: Dec 10 2008 00:10:06 [Sat Aug 01 11:34:08 2009] [notice] Parent: Created child process 3312 [Sat Aug 01 11:34:08 2009] [notice] Child 3312: Child process is running [Sat Aug 01 11:34:08 2009] [notice] Child 3312: Acquired the start mutex. [Sat Aug 01 11:34:08 2009] [notice] Child 3312: Starting 64 worker threads. [Sat Aug 01 11:34:08 2009] [notice] Child 3312: Starting thread to listen on port 80. [Sat Aug 01 11:35:04 2009] [notice] Parent: child process exited with status 255 -- Restarting. [Sat Aug 01 11:35:05 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.4 configured -- resuming normal operations [Sat Aug 01 11:35:05 2009] [notice] Server built: Dec 10 2008 00:10:06 [Sat Aug 01 11:35:05 2009] [notice] Parent: Created child process 264 [Sat Aug 01 11:35:05 2009] [notice] Child 264: Child process is running [Sat Aug 01 11:35:05 2009] [notice] Child 264: Acquired the start mutex. [Sat Aug 01 11:35:05 2009] [notice] Child 264: Starting 64 worker threads. [Sat Aug 01 11:35:05 2009] [notice] Child 264: Starting thread to listen on port 80. [Sat Aug 01 11:35:13 2009] [notice] Parent: child process exited with status 255 -- Restarting. [Sat Aug 01 11:35:13 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.4 configured -- resuming normal operations [Sat Aug 01 11:35:13 2009] [notice] Server built: Dec 10 2008 00:10:06 [Sat Aug 01 11:35:13 2009] [notice] Parent: Created child process 3596 [Sat Aug 01 11:35:13 2009] [notice] Child 3596: Child process is running [Sat Aug 01 11:35:13 2009] [notice] Child 3596: Acquired the start mutex. [Sat Aug 01 11:35:13 2009] [notice] Child 3596: Starting 64 worker threads. [Sat Aug 01 11:35:13 2009] [notice] Child 3596: Starting thread to listen on port 80.
php_error.log : pas d'entrée
mysql.log 090801 11:34:09 InnoDB: Started; log sequence number 0 74068517 090801 11:34:09 [Note] wampmysqld: ready for connections. Version: '5.0.45-community-nt' socket: '' port: 3306 MySQL Community Edition (GPL)
Il se pourrait que votre script en cause ait une boucle infinie.
Néanmoins, vous pouvez essayez d'augmenter le temps maximum imparti à un script ainsi que le maximum de mémoire dans wamp\bin\apache\apache2.2.11\bin\php.ini
max_execution_time = 360 ; Maximum execution time of each script, in seconds max_input_time = 360 ; Maximum amount of time each script may spend parsing request data memory_limit = 256M ; Maximum amount of memory a script may consume
Les scripts que j'utilise sont des scripts Joomla qui fonctionnent sur de nombreux sites en production.
Avec un autre script j'ai des erreurs php comme:
[04-août-2009 11:40:56] PHP Warning: fopen(http://localhost/images/com_sobi2/gallery/698/698_image_7.jpg) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Une tentative de connexion a échoué car le parti connecté n'a pas répondu convenablement au-delà d'une certaine durée ou une connexion établie a échoué car l'hôte de connexion n'a pas répondu. in C:\Wamp\www\components\com_sobi2\plugins\gallery\gallery.class.php on line 22
ou
[04-Aug-2009 11:48:47] PHP Warning: getimagesize(http://localhost/images/com_sobi2/gallery/698/698_image_10.jpg) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: Une tentative de connexion a échoué car le parti connecté n'a pas répondu convenablement au-delà d'une certaine durée ou une connexion établie a échoué car l'hôte de connexion n'a pas répondu. in C:\Wamp\www\components\com_sobi2\plugins\gallery\gallery.class.php on line 468
Les images sont bien présentes ; je pense que c'est Apache qui ne sait pas répondre car fopen et getimagesize sont des fonctions standard de php.
J'ai suivi vos conseils et cela a marché ! Il semble que les modifications sur le php.ini n'ont rien changé mais par contre que l'activation de modules supplémentaires dans le httpd.conf a réglé le problème. Sur mon serveur de production, Fedora core est paramétré avec presque tous les modules Apache activés alors que WAMP n'est paramétré au départ qu'avec très peu de modules activés. Merci de votre aide !