[Bug 1018750] New: [PHP/Apache] After installing php7 Apache did not recognize / run php webpage/scripts
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750 Bug ID: 1018750 Summary: [PHP/Apache] After installing php7 Apache did not recognize / run php webpage/scripts Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.2 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: bnc-team-screening@forge.provo.novell.com Reporter: richard.bos@xs4all.nl QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- After installing php7 (from devel:languages:php) and its related php7 Apache module 'apache2-mod_php7' Apache no longer recognized and run php scripts. The php script were interpreted as 'ASCII' / source files, and the browser replied with no x-php handler. Before installing php7, the system run fine with php-5.6.x and https enabled. After a long investigation it appears that the module php7 was not listed in the /etc/sysconfig/apache2 (nor php5). After installing the php7 rpms the message: An error appeared (or something similar, no further details provided). The only rpm (installed php7 related package) with scripts is: apache2-mod_php7-7.0.14-34.3.x86_64 The relevant part seems to be: # rpm -q -scripts apache2-mod_php7-7.0.14-34.3.x86_64 postinstall scriptlet (using /bin/sh): #some distro versions does not have this tool. if [ -x /usr/sbin/a2enmod ]; then if a2enmod -q php5 && ! a2enmod -q php7; then a2dismod php5 a2enmod php7 fi fi openSUSE has /usr/sbin/a2enmod so the part above seems applicable... In case php7 is installed from scratched (no php5 update), the module is not enabled at all, as php5 is not available in that case at all. Wouldn't it be better to check for php5 and php7 separately, like this: if a2enmod -q php5; then a2dismod php5 fi if ! a2enmod -q php7; then a2enmod php7 fi -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750#c1
Andreas Stieger
After installing php7 (from devel:languages:php)
Does this happen with openSUSE:Leap:42.2:Update/php7 ? (setting needinfo)
In case php7 is installed from scratched (no php5 update), the module is not enabled at all, as php5 is not available in that case at all. Wouldn't it be better to check for php5 and php7 separately, like this:
if a2enmod -q php5; then a2dismod php5 fi
if ! a2enmod -q php7; then a2enmod php7 fi
We always separated module installation from module activation. In other words, I would expect the module not to be enabled in the httpd configuration upon first installation or change from php5 to php7. Assigning to maintainers. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750#c2
Richard Bos
(In reply to Richard Bos from comment #0)
After installing php7 (from devel:languages:php)
Does this happen with openSUSE:Leap:42.2:Update/php7 ? (setting needinfo)
Can't say. I did not see that version before / I did not realize that php7 is part of the distribution. The install script is similar (the one from devel:languages:php) has a bit more. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750#c3
--- Comment #3 from Petr Gajdos
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750#c4
Petr Gajdos
We always separated module installation from module activation. In other words, I would expect the module not to be enabled in the httpd configuration upon first installation or change from php5 to php7.
Yes, exactly. And given this fact and that apache2-mod_php7 can not know there was apache2-mod_php5, I do not see any easy way out. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750#c5
Petr Gajdos
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750
http://bugzilla.opensuse.org/show_bug.cgi?id=1018750#c6
--- Comment #6 from Richard Bos
participants (1)
-
bugzilla_noreply@novell.com