IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Apache Discussion :

Erreurs 500 avec apache2/php5


Sujet :

Apache

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2007
    Messages : 4
    Points : 4
    Points
    4
    Par défaut Erreurs 500 avec apache2/php5
    Bonjour,

    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
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <html>
    <head>
    <title>Test PHP</title>
    </head>
    <body>
      <H1 align="center">
    Hello</H1>
    </body>
    </html>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    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
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    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

  2. #2
    Expert éminent sénior

    Profil pro
    Inscrit en
    Juin 2002
    Messages
    6 152
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 6 152
    Points : 17 778
    Points
    17 778
    Par défaut
    Et vous avez regardé le journal d'erreur ? Que vous indique-t-il dans le cas présent ?

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2007
    Messages : 4
    Points : 4
    Points
    4
    Par défaut
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    [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/

    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    lrwxrwxrwx 1 root root 24 2008-04-05 10:20 /var/www/public -> /home/jfact/Public_html/

  4. #4
    Expert éminent sénior

    Profil pro
    Inscrit en
    Juin 2002
    Messages
    6 152
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 6 152
    Points : 17 778
    Points
    17 778
    Par défaut
    Les modules userdir et suphp ne sont pas "compatibles" : il faut désactiver la vérification des chemins (le compiler avec l'option --disable-checkpath me semble-t-il) ou s'y prendre autrement.

    S'ajoute à cela un module log_sql mal configuré.

Discussions similaires

  1. Erreur 500 avec un script "cgi"
    Par tabouet dans le forum Autres langages pour le Web
    Réponses: 2
    Dernier message: 15/11/2009, 04h46
  2. erreur 500 avec firefox
    Par omercrafts dans le forum Général Conception Web
    Réponses: 3
    Dernier message: 10/08/2008, 23h25
  3. Erreur 500 avec CGI
    Par Neuromancien2 dans le forum Apache
    Réponses: 2
    Dernier message: 09/08/2008, 20h40
  4. [GD] Erreur 500 avec script d'une ligne
    Par keul dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 24/09/2007, 10h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo