Aller au contenu principal
Sujet: Reglage php (Lu 26 fois) sujet précédent - sujet suivant

Reglage php

Bonjour,
N'hesitez pas a me deplacer si je suis pas dans le bon forum.
Je viens d'installer 15.5 sur un nouveau ssd. Je suis a l'etape d'installation LAMP. Je me base sur cette url pour faire le setup.
Pour Apache "It works".
Et avant d'installer mariadb, j'ai installé php7.
It works mais it works juste en terminal.
127.0.0.1 n'a envoyé aucune donnée.
ERR_EMPTY_RESPONSE

Ce qui est dit
apache2.service - The Apache Webserver
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; disabled; vendor preset: disabled)
     Active: active (running) since Tue 2024-04-23 10:31:53 CEST; 14min ago
   Main PID: 4491 (httpd-prefork)
     Status: "Processing requests..."
      Tasks: 6
     CGroup: /system.slice/apache2.service
             ├─ 4491 /usr/sbin/httpd-prefork -DSYSCONFIG -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include /etc/apache2/sysconfig.d//global.conf" -f /etc/apache2/ht>
             ├─ 4542 /usr/sbin/httpd-prefork -DSYSCONFIG -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include /etc/apache2/sysconfig.d//global.conf" -f /etc/apache2/ht>
             ├─ 4556 /usr/sbin/httpd-prefork -DSYSCONFIG -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include /etc/apache2/sysconfig.d//global.conf" -f /etc/apache2/ht>
             ├─ 4587 /usr/sbin/httpd-prefork -DSYSCONFIG -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include /etc/apache2/sysconfig.d//global.conf" -f /etc/apache2/ht>
             ├─ 4777 /usr/sbin/httpd-prefork -DSYSCONFIG -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include /etc/apache2/sysconfig.d//global.conf" -f /etc/apache2/ht>
             └─ 8404 /usr/sbin/httpd-prefork -DSYSCONFIG -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include /etc/apache2/sysconfig.d//global.conf" -f /etc/apache2/ht>

En résumé de situation: phpinfo s'affiche dans le terminal, mais pas dans le navigateur.
Ca m'inspire une gestion erronée des droits utilisateur, vu que je me suis attribué les droits utilisateur sur /srv/www .. et que je suis pas top top sur chmod :-)

Vous en dites quoi ?
Cdt
Ooo

Re : Reglage php

Répondre #1
Quels sont les droits exacts de ton dossier /srv/www  ?
Qu'as-tu mis à l'intérieur et avec quels permissions ?
(la commande ls -l est ton amie)

phpinfo s'affiche dans le terminal ??? C'est-à-dire ???

As-tu relancer le serveur après tes changements (sudo systemctl reload apache2) ?


à plus,
oh!rocks

Re : Reglage php

Répondre #2
localhost:/srv/www/htdocs> ls -al
total 20
drwxrwxr-x 2 eric web    94 23 avril 01:10 .
drwxr-xr-x 4 root root   35 21 avril 23:16 ..
-rw-r--r-- 1 eric web   302 23 juil.  2008 favicon.ico
-rw-rw-r-- 1 eric web    50 22 avril 12:00 index.html
-rwxrwxrwx 1 eric users  24  7 nov.   2022 index.php
-rw-r--r-- 1 eric web    26 30 oct.  15:43 robots.txt
-rwxr-xr-x 1 eric www    20 23 avril 01:10 test.php

localhost:/srv/www> ls -al
total 0
drwxr-xr-x 4 root root 35 21 avril 23:16 .
drwxr-xr-x 4 root root 33 21 avril 23:21 ..
drwxr-xr-x 2 root root  6 15 mars   2022 cgi-bin
drwxrwxr-x 2 eric web  94 23 avril 01:10 htdocs

Mon idee au depart, c'est de me (eric) donner tous les droits sur htdocs
je pensais que c'etait le cas vu que "it works" s'affiche
mais php semble moins enthousiaste a s'afficher

Re : Reglage php

Répondre #3
Petit tour dans error_log me donne ca
Citer
[Tue Apr 23 15:24:49.726344 2024] [mpm_prefork:notice] [pid 4491] AH00170: caught SIGWINCH, shutting down gracefully
corrupted size vs. prev_size while consolidating
AH00557: httpd-prefork: apr_sockaddr_info_get() failed for localhost.localdomain
AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Tue Apr 23 15:24:50.007859 2024] [ssl:warn] [pid 13368] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Apr 23 15:24:50.032197 2024] [mpm_prefork:notice] [pid 13368] AH00163: Apache/2.4.51 (Linux/SUSE) OpenSSL/1.1.1l-fips PHP/7.4.33 PHP/8.0.30 configured -- resuming normal operations
[Tue Apr 23 15:24:50.032226 2024] [core:notice] [pid 13368] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -C PidFile /run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
[Tue Apr 23 15:25:07.050411 2024] [core:notice] [pid 13368] AH00052: child pid 13376 exit signal Segmentation fault (11)

J'arrive pas a synthetiser.
Histoire de cache. OK. J’appréhende mais ca me dit pas quoi faire et ou.
Ca dit aussi php8 alors que theoriquement je l'ai remplacé par le 7.4

ca donne une piste ?

Re : Reglage php

Répondre #4
C'est quoi ce groupe web ?

Apache2 a son propre groupe et utilisateur, il faut les utiliser.

user : wwwrun
group : www

Pour en bénéficier, tu ajoutes ton user aux groupes wwwrun et www et tu te reconnectes (passe par YaST > Utilsateurs et Sécurité > Gestion des groupes > Modifier > Détails et tu coches wwwrun et www dans la liste déroulant à droite, ni plus ,ni moins).

Ensuite tu changes les permissions de /srv/www/ à wwwrun:www

En ligne de commande : sudo chown -R wwwrun:www

Et tu redémarres Apache2 : sudo systemctl reload apache2

Et tu lis la doc : https://doc.opensuse.org/documentation/leap/reference/html/book-reference/cha-apache2.html

Apache2 est pointu (et complexe) à configurer correctement sur openSUSE (Leap ou autres). Si tu comptes l'utiliser quotidiennement avec des applis "à risques", passe plutôt sur Debian. L'installation est moins "user friendly" mais la doc est plus abondante y compris en français.


à plus,
oh!rocks

Re : Reglage php

Répondre #5
░░ The job identifier is 6284.
Apr 23 18:29:10 localhost.localdomain systemd[1]: Reloading The Apache Webserver...
░░ Subject: A reload job for unit apache2.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A reload job for unit apache2.service has begun execution.
░░
░░ The job identifier is 6393.
Apr 23 18:29:10 localhost.localdomain start_apache2[25031]: AH00557: httpd-prefork: apr_sockaddr_info_get() failed for localhost.localdomain
Apr 23 18:29:10 localhost.localdomain start_apache2[25031]: AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive global>
Apr 23 18:29:10 localhost.localdomain systemd[1]: apache2.service: Main process exited, code=dumped, status=6/ABRT
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit apache2.service has exited.
░░
░░ The process' exit code is 'dumped' and its exit status is 6.
Apr 23 18:29:10 localhost.localdomain systemd[1]: apache2.service: Failed with result 'core-dump'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit apache2.service has entered the 'failed' state with result 'core-dump'.
Apr 23 18:29:10 localhost.localdomain systemd[1]: Reload failed for The Apache Webserver.
░░ Subject: A reload job for unit apache2.service has finished
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A reload job for unit apache2.service has finished.
░░

Dans Utilisateurs
login-nom-uid-group => eric-eric-1000-users,www
Dans Groupes
nom-id-membres
users-100-wwwrun,eric

Il faut changer quoi vers ou ?

Re : Reglage php

Répondre #6
Dans utilsateurs, tu cliques sur la ligne de ton user, puis le bouton modifier et dans la fenêtre qui s'ouvre, dans le panneau de droite, tu fais défiler jusqu'en bas et tu coches les cases wwwrun et www. Et tu te reconnectes.

Sinon, ton Apache à l'air d'avoir un problème. Que donne la commande sudo apachectl -t ?


à plus,
oh!rocks

 

Re : Reglage php

Répondre #7
merci pour la reponse

Ca dit toujours la meme chose en fait :

AH00557: httpd-prefork: apr_sockaddr_info_get() failed for localhost.localdomain
AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

j'au cherche dans quelque .conf mais j'ai jamais trouvé servername .. a supposer que j'ai bien compris ce qui est dit !