pb d'installation avec apache2

Petit nouveau ! | 3 Messages

05 avr. 2008, 19:51

Bonjour,

Voilà, j'ai installé apache2 et php5 sur ubuntu 7.10.
Lorsque j'essaie d'exécuter un script hello.php, l'erreur "500 Internal Server Error" apparaît :

<< Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log. >>

Que se passe-t-il ?



Voici mon script et les packages installés :

--------------------------

php hello.php
<html>
<head>
<title>Test PHP</title>
</head>
<body>
<H1 align="center">
Hello</H1>
</body>
</html>


----------------------------------

root@jfact-laptop:~# dpkg -l | grep apache
ii apache2 2.2.4-3build1 Next generation, scalable, extendable web se
ii apache2-doc 2.2.4-3build1 documentation for apache2
ii apache2-mpm-prefork 2.2.4-3build1 Traditional model for Apache HTTPD
ii apache2-threaded-dev 2.2.4-3build1 development headers for apache2
ii apache2-utils 2.2.4-3build1 utility programs for webservers
ii apache2.2-common 2.2.4-3build1 Next generation, scalable, extendable web se
ii libapache2-mod-auth-mysql 4.3.9-4 Apache 2 module for MySQL authentication
ii libapache2-mod-auth-plain 2.0.48-4-2.2ubuntu1 Module for Apache2 which provides plaintext
ii libapache2-mod-fastcgi 2.4.2-8build1 Apache 2 FastCGI module for long-running CGI
ii libapache2-mod-log-sql 1.100-10 Use SQL to store/write your apache queries l
ii libapache2-mod-log-sql-mysql 1.100-10 Use SQL to store/write your apache queries l
ii libapache2-mod-log-sql-ssl 1.100-10 Use SQL to store/write your apache queries l
ii libapache2-mod-perl2 2.0.2-2.4ubuntu1 Integration of perl with the Apache2 web ser
ii libapache2-mod-perl2-dev 2.0.2-2.4ubuntu1 Integration of perl with the Apache2 web ser
ii libapache2-mod-perl2-doc 2.0.2-2.4ubuntu1 Integration of perl with the Apache2 web ser
ii libapache2-mod-php5 5.2.3-1ubuntu6 server-side, HTML-embedded scripting languag
ii libapache2-mod-python 3.3.1-2 Apache 2 module that embeds Python within th
ii libapache2-mod-python-doc 3.3.1-2 Apache 2 module that embeds Python within th
ii libapache2-mod-suphp 0.6.2-1ubuntu1 Apache2 module to run php scripts with the o

---------------------------------

root@jfact-laptop:~# dpkg -l | grep php5
ii libapache2-mod-php5 5.2.3-1ubuntu6 server-side, HTML-embedded scripting languag
ii php5 5.2.3-1ubuntu6 server-side, HTML-embedded scripting languag
ii php5-cgi 5.2.3-1ubuntu6 server-side, HTML-embedded scripting languag
ii php5-cli 5.2.3-1ubuntu6 command-line interpreter for the php5 script
ii php5-common 5.2.3-1ubuntu6 Common files for packages built from the php
ii php5-gd 5.2.3-1ubuntu6 GD module for php5
ii php5-mysql 5.2.3-1ubuntu6 MySQL module for php5

Petit nouveau ! | 3 Messages

07 avr. 2008, 10:56

comme je n'ai pas eu de reponse , je renouvelle ma demande d'aide par rapport a mon pb d'installation de php sur apac he (LAMP) car je suis un peu bloqué.

merci

Eléphant du PHP | 259 Messages

07 avr. 2008, 11:08

Hello,

T'as installé via les dépots ? T'as modifié la config initiale ?

Mammouth du PHP | 558 Messages

07 avr. 2008, 11:28

as-tu un .htaccess soit ton php.ini ne les accepte pas sois tu as une erreur dans ton htaccess.

Petit nouveau ! | 3 Messages

07 avr. 2008, 11:49

J'ai tout installé depuis les depots via synaptic. Je n'ai apporté aucune configuration.

J'ai seulement créé un lien pour accéder à mes scripts :

Code : Tout sélectionner

lrwxrwxrwx 1 root root 24 2008-04-05 10:20 /var/www/public -> /home/jfact/Public_html/

Voici ce que m'indique le fichier d'erreur /var/log/apache2/error.log au moment où j'accède à la page hello.php sur mozilla.

Code : Tout sélectionner

[Mon Apr 07 11:04:04 2008] [error] mod_log_sql: insufficient configuration info to establish database link [Mon Apr 07 11:04:04 2008] [error] mod_log_sql: child spawned but unable to open database link [Mon Apr 07 11:04:05 2008] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico [Mon Apr 07 11:04:05 2008] [error] mod_log_sql: insufficient configuration info to establish database link [Mon Apr 07 11:04:05 2008] [error] mod_log_sql: child spawned but unable to open database link [Mon Apr 07 11:04:05 2008] [error] mod_log_sql: insufficient configuration info to establish database link [Mon Apr 07 11:04:05 2008] [error] mod_log_sql: child spawned but unable to open database link [Mon Apr 07 11:04:11 2008] [error] [client 127.0.0.1] SoftException in Application.cpp:199: Script "/var/www/public/ex1/hello.php" resolving to "/home/jfact/Public_html//ex1/hello.php" not within configured docroot, referer: http://127.0.0.1/public/ex1/ [Mon Apr 07 11:04:11 2008] [error] [client 127.0.0.1] Premature end of script headers: hello.php, referer: http://127.0.0.1/public/ex1/

Modérateur PHPfrance
Modérateur PHPfrance | 7636 Messages

07 avr. 2008, 13:02

Modération :
Afin d'obtenir plus de réponses, le sujet est déplacé dans le forum "Gestion de serveur(s)".

/!\ Avant de poster se documenter et rechercher.
Qui ne sait pas rendre un service n'a pas le droit d'en demander.
MaBrute

Eléphant du PHP | 259 Messages

07 avr. 2008, 14:02

mysql-server est installé ? apache nécessite mysql pour écrire ses logs apparemment

accessoirement le lien symbolique que tu as créé est inutile. Si ma souvenance est bonne, le rep public_html est automatiquement reconnu sous ubuntu. Sinon il suffit de lier userdir.conf et userdir.load dans le dossier /etc/apache2/mods-enabled (ça doit pouvoir se faire avec a2enmod mais je suis pas persuadé)

ViPHP
ViPHP | 2287 Messages

07 avr. 2008, 15:43

<< Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log. >>

Que se passe-t-il ?
As-tu regardé dans l'error log du serveur et/ou du vhost ? Une erreur 500 laisse souvent un message (souvent très utile).
if(!@work()){ Nespresso(); } else { what(); }
______________________________

Mammouth du PHP | 1885 Messages

09 avr. 2008, 04:33

Faut probable que les permissions sur ton fichier .php soit mauvaise. suphp refusera (dépendamment des paramètres) d'exécuter un fichier qui n'a pas le bon propriétaire.
La programmation est l'expression de la poésie d'un programmeur
Génération PHP

Eléphanteau du PHP | 12 Messages

09 avr. 2008, 20:24

vu le message d erreur c'est typique htaccess ou vhost.. après faut voir ce qu'il y a dedans ;)