Partage
  • Partager sur Facebook
  • Partager sur Twitter

php et phpmyadmin ne fontionne pas

    5 février 2023 à 13:03:21

    Bonjour,

    Je suis nouveau sur linux (mint environnement gnome), j'ai nouvellement voulu installer apache2, phpmyadmin, php et mysql.

    Lorsque je me rend dans firefox sur "localhost/", mon fichier index.php s'éxécute correctement mais le php n'apparait pas.

    De plus, lorsque je me rend sur localhost/phpmyadmin, j'obtiens l'erreur suivante :

    Not Found

    The requested URL was not found on this server.


    <address>Apache/2.4.52 (Ubuntu) Server at localhost Port 80</address><address> </address><address> </address><address>Auriez vous des idées d'où ça pourrait venir ?</address><address>Merci d'avance</address><address> </address><address> </address>
    • Partager sur Facebook
    • Partager sur Twitter
      5 février 2023 à 13:24:12

      salut,

      quelle procédure as-tu suivie ?

      • Partager sur Facebook
      • Partager sur Twitter

      Validez la réponse utile « Un problème clairement exposé est à moitié résolu. » Pas de MP technique

        6 février 2023 à 0:04:22

        http://forum.wampserver.com/read.php?2,74970

        Celle ci mais certaines commande ne marchaient pas donc j'en ai changé certaines.

        Par exmaple : sudo apt-get install php5 libapache2-mod-php5 --> sudo apt-get install php libapache2-mod-php

        Etant donné que la plupart des commandes ne marchaient pas j'ai surtout installé les paquets sans trop toucher aux fichiers de config.

        J'ai donc installé apache2, phpmyadmin et php. Que dois-je faire maintenant pour que ces deux derniers fonctionnent ?

        • Partager sur Facebook
        • Partager sur Twitter
          6 février 2023 à 2:21:23

          2011 ! :o

          Ubuntu propose un Wiki à jour : https://doc.ubuntu-fr.org/lamp

          • Partager sur Facebook
          • Partager sur Twitter

          Validez la réponse utile « Un problème clairement exposé est à moitié résolu. » Pas de MP technique

            6 février 2023 à 18:10:27

            Merci pour ce lien, c'est plus clair que ce que j'avais suivi !

            J'ai donc refait la démarche avec ces nouvelles infos mais le php ne marche toujours pas. Mais php -v dans la cli réagit. Apache par contre marche parfaitement :

            Lorsque je fais localhost/ dans mon naviguateur ça m'affiche bien mon index.php mais uniquement le html et pas le php que j'ai incorporé (j'ai mis <?php echo('p') ?> juste pour faire un test).

            Ce doit être un problème de configuration je pense ? Peut-être qq chose à voir dans le php.ini ? je ne sais pas.

            De plus pour phpmyadmin, j'ai suivi la documentation https://doc.ubuntu-fr.org/phpmyadmin

            J'ai donc réinstallé phpmyadmin en sélectionnant apache2 avec la barre espace ce que je n'avait pas fait. J'ai donc un petit mieux quand je tape localhost/phpmyadmin j'ai un page blanche au lieu de 404 not found.

            Là encore est ce que ce n'est pas un problème de configuration de phpmyadmin?

            Merci de votre aide

            • Partager sur Facebook
            • Partager sur Twitter
              7 février 2023 à 14:48:32

              2011, aussi vieux que l'environnement php-mysql-apache. Suis tu un cours pour faire du développement web ? Si oui sache qu'il y a bien plus sympa que du php de nos jours (et des serveurs http plus décent que apache).

              Pour ton problème il faut assigner les fichiers .php en cgi/fastcgi pour l'interpréteur php. Si tu as une page blanche, il serait intéressant de regarder les logs du serveur web, on ne peut pas deviner le problème.

              -
              Edité par markand 7 février 2023 à 14:48:43

              • Partager sur Facebook
              • Partager sur Twitter

              git is great because Linus did it, mercurial is better because he didn't.

                7 février 2023 à 23:45:29

                Pour les fichiers log, j'ai regardé mon fichier access.example.com.log (car mon site local s'appelle example.com et j'ai paramétré apache dessus) voici le résultat :

                127.0.0.1 - - [06/Feb/2023:17:42:42 +0100] "GET / HTTP/1.1" 200 302 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [06/Feb/2023:17:46:03 +0100] "GET /phpmyadmin/ HTTP/1.1" 404 488 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:17:51:55 +0100] "GET /phpmyadmin/ HTTP/1.1" 404 488 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:17:51:56 +0100] "GET /phpmyadmin/ HTTP/1.1" 404 487 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:17:55:22 +0100] "GET /phpmyadmin/ HTTP/1.1" 404 488 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:00:22 +0100] "GET /phpmyadmin/ HTTP/1.1" 404 488 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:06:53 +0100] "GET /phpmyadmin/ HTTP/1.1" 200 673 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:07:22 +0100] "GET /phpmyadmin/ HTTP/1.1" 304 249 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:07:24 +0100] "GET /phpmyadmin/ HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:07:24 +0100] "GET /phpmyadmin/ HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:07:25 +0100] "GET /phpmyadmin/ HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [06/Feb/2023:18:08:54 +0100] "GET / HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [06/Feb/2023:19:54:20 +0100] "GET / HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [06/Feb/2023:19:54:24 +0100] "GET /favicon.ico HTTP/1.1" 404 487 "http://localhost/phpmyadmin/" "Mozilla/5.0 (X11; Linux x86_64; rv>
                127.0.0.1 - - [06/Feb/2023:22:54:56 +0100] "GET /phpmyadmin/ HTTP/1.1" 304 249 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [07/Feb/2023:23:24:55 +0100] "GET / HTTP/1.1" 200 302 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [07/Feb/2023:23:24:55 +0100] "GET /favicon.ico HTTP/1.1" 404 487 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gec>
                127.0.0.1 - - [07/Feb/2023:23:29:01 +0100] "GET / HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [07/Feb/2023:23:29:06 +0100] "GET /phpmyadmin HTTP/1.1" 301 576 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firef>
                127.0.0.1 - - [07/Feb/2023:23:29:06 +0100] "GET /phpmyadmin/ HTTP/1.1" 200 673 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Fire>
                127.0.0.1 - - [07/Feb/2023:23:33:24 +0100] "GET / HTTP/1.1" 200 314 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [07/Feb/2023:23:33:25 +0100] "GET / HTTP/1.1" 304 247 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [07/Feb/2023:23:33:25 +0100] "GET / HTTP/1.1" 304 247 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                127.0.0.1 - - [07/Feb/2023:23:33:45 +0100] "GET / HTTP/1.1" 304 248 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
                
                


                Concernant mon error.example.com.log il est vide

                Et voici mon error.log :

                  GNU nano 6.2                                                                                                                                                                              error.log                                                                                                                                                                                  M     
                [Mon Feb 06 00:00:05.939020 2023] [mpm_event:notice] [pid 23116:tid 140581515343744] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 00:00:05.939037 2023] [core:notice] [pid 23116:tid 140581515343744] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 00:05:13.424753 2023] [mpm_event:notice] [pid 23116:tid 140581515343744] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 14:13:58.232354 2023] [mpm_event:notice] [pid 1012:tid 140036449388416] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 14:13:58.232703 2023] [core:notice] [pid 1012:tid 140036449388416] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 17:20:33.015456 2023] [mpm_event:notice] [pid 1012:tid 140036449388416] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 17:20:33.058459 2023] [mpm_event:notice] [pid 13269:tid 140342990833536] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 17:20:33.058531 2023] [core:notice] [pid 13269:tid 140342990833536] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 17:20:45.618791 2023] [mpm_event:notice] [pid 13269:tid 140342990833536] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 17:20:50.092895 2023] [mpm_event:notice] [pid 13358:tid 140005313767296] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 17:20:50.092992 2023] [core:notice] [pid 13358:tid 140005313767296] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 17:41:04.199418 2023] [mpm_event:notice] [pid 13358:tid 140005313767296] AH00493: SIGUSR1 received.  Doing graceful restart
                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                [Mon Feb 06 17:41:04.205501 2023] [mpm_event:notice] [pid 13358:tid 140005313767296] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 17:41:04.205513 2023] [core:notice] [pid 13358:tid 140005313767296] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 17:42:01.295976 2023] [mpm_event:notice] [pid 13358:tid 140005313767296] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 17:42:01.336260 2023] [mpm_event:notice] [pid 14311:tid 140423971432320] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 17:42:01.336350 2023] [core:notice] [pid 14311:tid 140423971432320] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 17:42:37.755518 2023] [mpm_event:notice] [pid 14311:tid 140423971432320] AH00493: SIGUSR1 received.  Doing graceful restart
                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                [Mon Feb 06 17:42:37.759572 2023] [mpm_event:notice] [pid 14311:tid 140423971432320] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 17:42:37.759578 2023] [core:notice] [pid 14311:tid 140423971432320] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 17:57:37.661575 2023] [mpm_event:notice] [pid 14311:tid 140423971432320] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 17:58:01.774174 2023] [mpm_event:notice] [pid 969:tid 140552506988416] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 17:58:01.774452 2023] [core:notice] [pid 969:tid 140552506988416] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 18:06:36.127397 2023] [mpm_event:notice] [pid 969:tid 140552506988416] AH00493: SIGUSR1 received.  Doing graceful restart
                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                [Mon Feb 06 18:06:36.142479 2023] [mpm_event:notice] [pid 969:tid 140552506988416] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 18:06:36.142507 2023] [core:notice] [pid 969:tid 140552506988416] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 18:06:36.367811 2023] [mpm_event:notice] [pid 969:tid 140552506988416] AH00493: SIGUSR1 received.  Doing graceful restart
                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                [Mon Feb 06 18:06:36.383418 2023] [mpm_event:notice] [pid 969:tid 140552506988416] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 18:06:36.383447 2023] [core:notice] [pid 969:tid 140552506988416] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 18:07:17.822194 2023] [mpm_event:notice] [pid 969:tid 140552506988416] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 18:07:17.923101 2023] [mpm_event:notice] [pid 4846:tid 139783763613568] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 18:07:17.923422 2023] [core:notice] [pid 4846:tid 139783763613568] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 18:10:57.464900 2023] [mpm_event:notice] [pid 4846:tid 139783763613568] AH00492: caught SIGWINCH, shutting down gracefully
                [Mon Feb 06 19:53:12.742795 2023] [mpm_event:notice] [pid 966:tid 139962030557056] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Mon Feb 06 19:53:12.743152 2023] [core:notice] [pid 966:tid 139962030557056] AH00094: Command line: '/usr/sbin/apache2'
                [Mon Feb 06 22:55:43.513646 2023] [mpm_event:notice] [pid 966:tid 139962030557056] AH00492: caught SIGWINCH, shutting down gracefully
                [Tue Feb 07 11:09:20.007422 2023] [mpm_event:notice] [pid 1011:tid 139650964977536] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Tue Feb 07 11:09:20.007664 2023] [core:notice] [pid 1011:tid 139650964977536] AH00094: Command line: '/usr/sbin/apache2'
                [Tue Feb 07 16:41:54.692125 2023] [mpm_event:notice] [pid 1011:tid 139650964977536] AH00492: caught SIGWINCH, shutting down gracefully
                [Tue Feb 07 17:08:36.450262 2023] [mpm_event:notice] [pid 987:tid 140295926388608] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Tue Feb 07 17:08:36.461039 2023] [core:notice] [pid 987:tid 140295926388608] AH00094: Command line: '/usr/sbin/apache2'
                [Tue Feb 07 18:14:07.297355 2023] [mpm_event:notice] [pid 987:tid 140295926388608] AH00492: caught SIGWINCH, shutting down gracefully
                [Tue Feb 07 20:35:06.101483 2023] [mpm_event:notice] [pid 995:tid 140451633149824] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Tue Feb 07 20:35:06.101747 2023] [core:notice] [pid 995:tid 140451633149824] AH00094: Command line: '/usr/sbin/apache2'
                [Tue Feb 07 22:02:27.169972 2023] [mpm_event:notice] [pid 995:tid 140451633149824] AH00492: caught SIGWINCH, shutting down gracefully
                [Tue Feb 07 23:21:49.433198 2023] [mpm_event:notice] [pid 992:tid 139988055689088] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Tue Feb 07 23:21:49.433427 2023] [core:notice] [pid 992:tid 139988055689088] AH00094: Command line: '/usr/sbin/apache2'
                [Tue Feb 07 23:33:43.051389 2023] [mpm_event:notice] [pid 992:tid 139988055689088] AH00492: caught SIGWINCH, shutting down gracefully
                [Tue Feb 07 23:33:43.151804 2023] [mpm_event:notice] [pid 3644:tid 140318978967424] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
                [Tue Feb 07 23:33:43.152091 2023] [core:notice] [pid 3644:tid 140318978967424] AH00094: Command line: '/usr/sbin/apache2'
                


                "Pour ton problème il faut assigner les fichiers .php en cgi/fastcgi pour l'interpréteur php."

                Est ce que tu peux m'en dire plus sur comment faire ça ?

                Merci

                Pierre

                • Partager sur Facebook
                • Partager sur Twitter
                  9 février 2023 à 13:17:13

                  ChatGPTa résolu le problème;

                  Après avoir tapé :

                  J'ai eu une erreur de conflit entre mpm_event et mpm-prefork

                  sudo apt-get install apache2 php8.1

                  J'ai eu une erreur de conflit entre mpm_event et mpm-prefork

                  Il m'a dit de taper :

                  sudo a2dismod mpm_event sudo a2enmod mpm_prefork
                  sudo a2enmod php8.1
                  sudo systemctl restart apache2

                  • Partager sur Facebook
                  • Partager sur Twitter
                    9 février 2023 à 17:22:14

                    qu'est-ce qu'il est doué ce chatGPT quand on lui pose les bonnes questions !
                    • Partager sur Facebook
                    • Partager sur Twitter

                    Validez la réponse utile « Un problème clairement exposé est à moitié résolu. » Pas de MP technique

                    php et phpmyadmin ne fontionne pas

                    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                    • Editeur
                    • Markdown