Mailinglist Archive: opensuse-bugs (4250 mails)

< Previous Next >
[Bug 1018750] New: [PHP/Apache] After installing php7 Apache did not recognize / run php webpage/scripts
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Sun, 08 Jan 2017 08:26:32 +0000
  • Message-id: <>

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@xxxxxxxxxxxxxxxxxxxxxx
Reporter: richard.bos@xxxxxxxxx
QA Contact: qa-bugs@xxxxxxx
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:

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

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

if ! a2enmod -q php7; then
a2enmod php7

You are receiving this mail because:
You are on the CC list for the bug.
< Previous Next >