2 votes

PHP ne fonctionne pas après la mise à niveau vers Catalina

J'ai suivi tous les tutoriels, mis à jour httpd.conf et d'autres fichiers. Apache fonctionne bien mais PHP ne semble pas activé. En pointant vers php_info.php =>

<?php phpinfo() ?>

J'ai déjà utilisé High Sierra sans aucun problème avec apache et php. La mise à jour vers Catalina a évidemment cassé cela. PHP n'est pas activé bien que la ligne du module soit décommentée dans httpd.conf. Rien dans la configuration n'indique que PHP ne fonctionne pas, mais lorsque je dirige un navigateur vers un fichier PHP, il ne traite pas la page mais affiche simplement le code - comme mentionné, php_info.php n'affiche pas la page d'information, seulement le code php.

C'est l'installation apache/php fournie avec Catalina.

Journal des erreurs d'Apache :

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Tobys-iMac.local. Set the 'ServerName' directive globally to suppress this message

[Wed Jan 08 22:05:26.428368 2020] [mpm_prefork:notice] [pid 159] AH00163: Apache/2.4.41 (Unix) PHP/7.3.9 configured -- resuming normal operations

[Wed Jan 08 22:05:26.428420 2020] [core:notice] [pid 159] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

[Wed Jan 08 22:09:52.550744 2020] [mpm_prefork:notice] [pid 159] AH00169: caught SIGTERM, shutting down

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Tobys-iMac.local. Set the 'ServerName' directive globally to suppress this message

[Wed Jan 08 22:10:48.678248 2020] [mpm_prefork:notice] [pid 159] AH00163: Apache/2.4.41 (Unix) PHP/7.3.9 configured -- resuming normal operations

[Wed Jan 08 22:10:48.678307 2020] [core:notice] [pid 159] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Access log:

::1 - - [09/Jan/2020:11:06:05 -0800] "GET /php_info.php HTTP/1.1" 200 18

::1 - - [09/Jan/2020:11:07:47 -0800] "GET /php_info.php HTTP/1.1" 200 18

::1 - - [09/Jan/2020:11:08:37 -0800] "GET /index.php HTTP/1.1" 304 -

::1 - - [09/Jan/2020:11:08:39 -0800] "GET /index.php HTTP/1.1" 200 16

::1 - - [09/Jan/2020:11:09:51 -0800] "GET /ePub%20Processing/process_toc-content.php HTTP/1.1" 200 7653

0 votes

Avez-vous vérifié httpd.conf ? Comment avez-vous installé PHP/Apache ? Est-ce la version par défaut fournie avec MacOS ou avez-vous installé une version mise à jour via Hombrew, MacPorts, ou manuellement ? Veuillez modifier votre question en y ajoutant les détails pertinents.

0 votes

Y a-t-il quelque chose d'intéressant dans le journal et les fichiers d'erreur d'Apache ? Que voulez-vous dire par "PHP n'est pas activé" ?

4voto

Toby Tucker Points 61

J'ai trouvé une réponse qui a fonctionné :

# added this to made php render
<IfModule php7_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>

LesApples.com

LesApples est une communauté de Apple où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres utilisateurs d'appareils Apple, poser vos propres questions ou résoudre celles des autres.

Powered by:

X