Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 05/09/2007, à 23:00

titirock

[Résolu]PHP4 CGI PHP5 en module (DSO) sur Apache 2.2

Bonjour,

Je suis en train de me monter un serveur LAMP avec mes ptites mimines pour un tutos, et avec les version "sources" de PHP 4 (4.4.7) en CGI, PHP 5 en DSO (5.2.4) et Apache 2. La compilation des logiciels s'effectuée sans problème. je bute sur la configuration. Je précise que j'ai déjà réussi la manip avec Apache sous Windows et que j'ai déjà monté des serveurs LAMP, mais avec seulement PHP 5 en DSO.

Donc voilà mon problème :

J'ai ajouté cette directive à httpd.conf

Include /etc/apache2.2/php.conf

et voici le php.conf

##Configuration de PHP5
#
AddType application/x-http-php .php .phtml

##Configuration de PHP4
#
ScriptAlias	/php4/		/usr/local/php4/bin
AddType	application/x-httpd-php4	.php4
Action	application/x-httpd-php4	/php4/php

<Directory /usr/local/php4/bin>
	Options FollowSymLinks ExecCGI
	AllowOverride none
	Order allow,deny
	Allow from all
</Directory>

J'ai créé deux fichiers de tests infos.php et infos.php4 dans /var/www avec les droits adéquats. Seulement mon navigateur cherche à télécharger le fichier .php et me renvoie une belle erreur 403 avec le fichier .php4, et mon fichier error_log est plein de

[Wed Sep 05 23:35:54 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Sep 05 23:35:54 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8a PHP/5.2.4 configured -- resuming normal operations
[Wed Sep 05 23:37:40 2007] [error] [client 192.168.1.20] Directory index forbidden by Options directive: /var/www/
[Wed Sep 05 23:39:45 2007] [notice] SIGHUP received.  Attempting to restart
[Wed Sep 05 23:39:45 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8a PHP/5.2.4 configured -- resuming normal operations
[Wed Sep 05 23:39:57 2007] [error] [client 192.168.1.20] Directory index forbidden by Options directive: /var/www/
[Wed Sep 05 23:39:59 2007] [error] [client 192.168.1.20] Directory index forbidden by Options directive: /var/www/
[Wed Sep 05 23:40:00 2007] [error] [client 192.168.1.20] Directory index forbidden by Options directive: /var/www/
[Wed Sep 05 23:40:14 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp
[Wed Sep 05 23:42:23 2007] [notice] SIGHUP received.  Attempting to restart
[Wed Sep 05 23:42:24 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8a PHP/5.2.4 configured -- resuming normal operations
[Wed Sep 05 23:42:40 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp
[Wed Sep 05 23:42:41 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp
[Wed Sep 05 23:45:48 2007] [notice] SIGHUP received.  Attempting to restart
Syntax error on line 12 of /etc/apache2.2/php.conf:
Illegal option FollowSymLinks,ExecCGI
[Wed Sep 05 23:46:09 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Sep 05 23:46:09 2007] [warn] pid file /usr/local/apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Sep 05 23:46:09 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8a PHP/5.2.4 configured -- resuming normal operations
[Wed Sep 05 23:46:10 2007] [notice] SIGHUP received.  Attempting to restart
[Wed Sep 05 23:46:10 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8a PHP/5.2.4 configured -- resuming normal operations
[Wed Sep 05 23:46:15 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp
[Wed Sep 05 23:46:17 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp
[Wed Sep 05 23:46:18 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp
[Wed Sep 05 23:47:08 2007] [error] [client 192.168.1.20] client denied by server configuration: /usr/local/php4/binphp

je ne comprends pas où est l'erreur.

Merci de votre aide si quelqu'un a une idée, je prends!! big_smile

PS voici mes directives de compilation :
pour PHP4:

#! /bin/sh
#
# Created by configure

'./configure' \
'--prefix=/usr/local/php4' \
'--enable-fastcgi' \
'--enable-force-cgi-redirect' \
'--with-mysql' \
'--with-pgsql' \
'--with-mssql' \
'--with-zlib' \
'--enable-exif' \
'--enable-ftp' \
'--enable-calendar' \
'--with-gd' \
'--with-gettext' \
'--enable-sqlite-utf8' \
'--with-ldap' \
"$@"

pour PHP5:

#! /bin/sh
#
# Created by configure

'./configure' \
'--prefix=/usr/local/php5' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-mysql' \
'--with-mysqli' \
'--with-pdo-mysql' \
'--with-pgsql' \
'--with-pdo-pgsql' \
'--with-mssql' \
'--with-zlib' \
'--enable-exif' \
'--enable-ftp' \
'--enable-calendar' \
'--with-gd' \
'--with-gettext' \
'--enable-sqlite-utf8' \
'--with-ldap' \
'--disable-cgi' \
"$@"

et Apache2.2

#! /bin/sh
#
# Created by configure

"./configure" \
"--enable-modules=so dbd cgi ssl" \
"--enable-mods-shared=authn-anon authn-dbd authn-alias cache mime-magic headers ssl imagemap version speling rewrite info" \
"--sysconfdir=/etc/apache2.2" \
"$@"

Dernière modification par titirock (Le 07/09/2007, à 11:33)


Alice est née au pays des cauchemars,
Je voudrais juste la rassurer...
--------------------------------------
http://www.tuxalafenetre.net

Hors ligne

#2 Le 07/09/2007, à 00:01

titirock

Re : [Résolu]PHP4 CGI PHP5 en module (DSO) sur Apache 2.2

Bon j'arrive désormais à faire fonctionne PHP4 en CGI, j'avais une erreur dans mon fichier php.conf, il manquait un / à la ligne /usr/local/php4/bin, et il fallait que mette le chemin entre guillemets.

Par contre , il ne veut toujours pas de mes fichiers .php pour PHP5 sad ...


Alice est née au pays des cauchemars,
Je voudrais juste la rassurer...
--------------------------------------
http://www.tuxalafenetre.net

Hors ligne

#3 Le 07/09/2007, à 10:55

titirock

Re : [Résolu]PHP4 CGI PHP5 en module (DSO) sur Apache 2.2

Bon j'ai trouvé la solution pour mon problème de .php...
J'avais oublié le d pour x-httpd-php...maitenant tout fonctionne!

Voici mon php.conf corrigé pour ceux que ça interesse :

##Configuration de PHP5
#
AddType application/x-httpd-php .php .phtml

##Configuration de PHP4
#
ScriptAlias    /php4/        "/usr/local/php4/bin/"
AddType    application/x-httpd-php4    .php4
Action    application/x-httpd-php4    /php4/php

<Directory "/usr/local/php4/bin/">
    Options None
    AllowOverride none
    Order allow,deny
    Allow from all
</Directory>

Alice est née au pays des cauchemars,
Je voudrais juste la rassurer...
--------------------------------------
http://www.tuxalafenetre.net

Hors ligne