Reglage php 23 Avril, 2024, 11:01:29 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.Code: [Sélectionner]127.0.0.1 n'a envoyé aucune donnée.ERR_EMPTY_RESPONSECe qui est ditCode: [Sélectionner]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 ?CdtOoo Citer la sélection
Re : Reglage php Répondre #1 – 23 Avril, 2024, 13:52:01 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 Citer la sélection
Re : Reglage php Répondre #2 – 23 Avril, 2024, 14:14:28 Code: [Sélectionner]localhost:/srv/www/htdocs> ls -altotal 20drwxrwxr-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.phplocalhost:/srv/www> ls -altotal 0drwxr-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-bindrwxrwxr-x 2 eric web 94 23 avril 01:10 htdocsMon idee au depart, c'est de me (eric) donner tous les droits sur htdocsje pensais que c'etait le cas vu que "it works" s'affichemais php semble moins enthousiaste a s'afficher Citer la sélection
Re : Reglage php Répondre #3 – 23 Avril, 2024, 15:46:11 Petit tour dans error_log me donne caCiter[Tue Apr 23 15:24:49.726344 2024] [mpm_prefork:notice] [pid 4491] AH00170: caught SIGWINCH, shutting down gracefullycorrupted size vs. prev_size while consolidatingAH00557: httpd-prefork: apr_sockaddr_info_get() failed for localhost.localdomainAH00558: 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.4ca donne une piste ? Citer la sélection
Re : Reglage php Répondre #4 – 23 Avril, 2024, 16:53:16 C'est quoi ce groupe web ?Apache2 a son propre groupe et utilisateur, il faut les utiliser.user : wwwrungroup : wwwPour 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:wwwEn ligne de commande : sudo chown -R wwwrun:wwwEt tu redémarres Apache2 : sudo systemctl reload apache2Et tu lis la doc : https://doc.opensuse.org/documentation/leap/reference/html/book-reference/cha-apache2.htmlApache2 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 Citer la sélection
Re : Reglage php Répondre #5 – 23 Avril, 2024, 19:57:39 Code: [Sélectionner]░░ 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.localdomainApr 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 Utilisateurslogin-nom-uid-group => eric-eric-1000-users,wwwDans Groupesnom-id-membresusers-100-wwwrun,ericIl faut changer quoi vers ou ? Citer la sélection
Re : Reglage php Répondre #6 – 23 Avril, 2024, 20:41:00 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 Citer la sélection
Re : Reglage php Répondre #7 – 23 Avril, 2024, 21:37:40 merci pour la reponseCa dit toujours la meme chose en fait :Code: [Sélectionner]AH00557: httpd-prefork: apr_sockaddr_info_get() failed for localhost.localdomainAH00558: 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 messageSyntax OKj'au cherche dans quelque .conf mais j'ai jamais trouvé servername .. a supposer que j'ai bien compris ce qui est dit ! Citer la sélection
Re : Reglage php Répondre #8 – 24 Avril, 2024, 11:24:41 BonjourPersonnellement, je suis d'accord avec @oh!rocks , il faut les propres groupes et droits d'Apache. Tu peux tenter de modifier une configuration de droits et de proprio, si ça fonctionne pas, revenir à la configuration d'origine. Car à force de modifier, tu vas perdre ta configuration d'origine d' Apache.Permissions des droits répertoires et des fichiers d'origine: Code: [Sélectionner]sudo chmod -R 755 /srv/www/htdocssudo chmod 644 /srv/www/htdocs/*.html /srv/www/htdocs/*.phpPermissions Propriétaire, groupe ...d'origine :(wwwrun:www ) est spécifique à opensuse wwwrunCode: [Sélectionner]sudo chown -R wwwrun:www /srv/www/htdocsMaintenant, si tu veux changer tous ces droits, tu peux, et si ça ne fonctionne pas, reviens à la configuration d'origine.Configuration d'Apache :Les logs d'Apache indiquent une erreur: "AH00557: httpd-prefork: apr_sockaddr_info_get() failed for localhost.localdomain".Ça signifie qu'Apache ne peut pas déterminer le nom de domaine complet du serveur.Modifie le fichier de config d'Apache (httpd.conf) .Recherche : ServerName. Si c'est commenté, décommente-le et définit le sur :- localhost ou l'adresse IP locale de ton serveur.Redémarre Apache et essaye d'accéder à : test.php Citer la sélection Dernière édition : 24 Avril, 2024, 11:31:58 par Yoman
Re : Reglage php Répondre #9 – 24 Avril, 2024, 12:07:43 Bon. Finalement, ce que j'ai compris c'est que ca n'est pas une question de droits (dans l'etat en tous cas).Pour le reste, ca fonctionne. Je suspecte des explications a ca, mais ca serait long.. et probablement inutile de m'y étendre.Affaire classée. Merci aux intervenants !Apres, je peux detailler quand meme..J'ai installé php7 avec zypper:Code: [Sélectionner]zypper in php7 php apache2-mod_php7 php7-curl php7-xmlreader php7-zip php7-pdo php7-gd php7-json php7-mysql php7-mbstring php7-opensslet en regardant avec Yast Serveur Web et Lamp, je me suis apercu que Apache2_Mod_Php n'etait pas coché.Je pense que le probleme venat de la en fait.Tx Citer la sélection 1 J'aime Apprécié par : Yoman