PHP code does not become executed on html files. If it’s in a PHP file, that will be offered for download but not executed.
Following several posts t tried
a2enmod php7.
But then apach2 does not start anymore.
gwain:~ # a2enmod php7
gwain:~ # service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
If I disable php7 then apache2 starts again
gwain:~ # a2dismod php7
gwain:~ # service apache2 restart
gwain:~ #
And what shows
systemctl status apache2.service
and
journalctl -xe
We are not sitting behind you (so far).
gwain:~ # systemctl status apache2.service
● apache2.service - The Apache Webserver
Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2023-08-02 06:45:45 CEST; 1min 55s ago
Process: 6625 ExecStop=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful-stop (code=exited, status=1/FAILU>
Process: 6635 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
Main PID: 6635 (code=exited, status=1/FAILURE)
Aug 02 06:45:45 gwain.fritz.box systemd[1]: Starting The Apache Webserver...
Aug 02 06:45:45 gwain.fritz.box start_apache2[6635]: [Wed Aug 02 06:45:45.601825 2023] [php7:crit] [pid 6635:tid 1400>
Aug 02 06:45:45 gwain.fritz.box start_apache2[6635]: AH00013: Pre-configuration failed
Aug 02 06:45:45 gwain.fritz.box systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Aug 02 06:45:45 gwain.fritz.box systemd[1]: Failed to start The Apache Webserver.
Aug 02 06:45:45 gwain.fritz.box systemd[1]: apache2.service: Unit entered failed state.
Aug 02 06:45:45 gwain.fritz.box systemd[1]: apache2.service: Failed with result 'exit-code'.
anf journalctl .xe
-- Unit apache2.service has begun starting up.
Aug 02 06:45:45 gwain.fritz.box start_apache2[6635]: [Wed Aug 02 06:45:45.601825 2023] [php7:crit] [pid 6635:tid 140030117607680] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Aug 02 06:45:45 gwain.fritz.box start_apache2[6635]: AH00013: Pre-configuration failed
Aug 02 06:45:45 gwain.fritz.box systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Aug 02 06:45:45 gwain.fritz.box systemd[1]: Failed to start The Apache Webserver.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Aug 02 06:45:45 gwain.fritz.box systemd[1]: apache2.service: Unit entered failed state.
Aug 02 06:45:45 gwain.fritz.box systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 02 06:45:58 gwain.fritz.box kwin_x11[1927]: qt.qpa.xcb: Unhandled client message: "_NET_CURRENT_DESKTOP"
Aug 02 06:46:19 gwain.fritz.box kwin_x11[1927]: qt.qpa.xcb: Unhandled client message: "_NET_CURRENT_DESKTOP"
Aug 02 06:49:18 gwain.fritz.box NetworkManager[1047]: <info> [1690951758.7709] device (wlan1): set-hw-addr: set MAC address to 96:E0:80:FF:00:9A (scanning)
Aug 02 06:49:18 gwain.fritz.box NetworkManager[1047]: <info> [1690951758.8106] device (wlan1): supplicant interface state: inactive -> disconnected
Aug 02 06:49:18 gwain.fritz.box NetworkManager[1047]: <info> [1690951758.8106] device (p2p-dev-wlan1): supplicant management interface state: inactive -> disconnected
Aug 02 06:49:18 gwain.fritz.box NetworkManager[1047]: <info> [1690951758.8164] device (wlan1): supplicant interface state: disconnected -> inactive
Aug 02 06:49:18 gwain.fritz.box NetworkManager[1047]: <info> [1690951758.8168] device (p2p-dev-wlan1): supplicant management interface state: disconnected -> inactive
Aug 02 06:51:23 gwain.fritz.box kdeinit5[6765]: Qt: Session management error: networkIdsList argument is NULL
The answer inbold is fron a bot isn’t it?
Great!
Then why is my PHP module not threadsve?
It is from the standard distribution!
However, it was in the wrong directory.
So i created a symlink,
gwain:~ # ls -l /usr/lib64/apache2-prefork/mod_php7.so
lrwxrwxrwx 1 root root 30 Aug 1 17:31 /usr/lib64/apache2-prefork/mod_php7.so -> /usr/lib64/apache2/mod_php7.so
This is where yast installs it
What it is in /etc/sysconfig/apache2 configured for mpm?
APACHE_MPM="prefork"
or something else?
gwain:~ # grep APACHE_MPM /etc/sysconfig/apache2
APACHE_MPM=“”
Sorry, I was on vacation.
I’ve done that but nothing has changed.
For my early attempts I still have the ling to th PHP7 library in the apache2-prefork directory.
Should I remove that?
gwain:~ # cat /etc/apache2/loadmodule.conf
LoadModule actions_module /usr/lib64/apache2-prefork/mod_actions.so
LoadModule alias_module /usr/lib64/apache2-prefork/mod_alias.so
LoadModule auth_basic_module /usr/lib64/apache2-prefork/mod_auth_basic.so
LoadModule authn_file_module /usr/lib64/apache2-prefork/mod_authn_file.so
LoadModule authz_host_module /usr/lib64/apache2-prefork/mod_authz_host.so
LoadModule authz_groupfile_module /usr/lib64/apache2-prefork/mod_authz_groupfile.so
LoadModule authz_user_module /usr/lib64/apache2-prefork/mod_authz_user.so
LoadModule autoindex_module /usr/lib64/apache2-prefork/mod_autoindex.so
LoadModule cgi_module /usr/lib64/apache2-prefork/mod_cgi.so
LoadModule dir_module /usr/lib64/apache2-prefork/mod_dir.so
LoadModule env_module /usr/lib64/apache2-prefork/mod_env.so
LoadModule expires_module /usr/lib64/apache2-prefork/mod_expires.so
LoadModule include_module /usr/lib64/apache2-prefork/mod_include.so
LoadModule log_config_module /usr/lib64/apache2-prefork/mod_log_config.so
LoadModule mime_module /usr/lib64/apache2-prefork/mod_mime.so
LoadModule negotiation_module /usr/lib64/apache2-prefork/mod_negotiation.so
LoadModule setenvif_module /usr/lib64/apache2-prefork/mod_setenvif.so
LoadModule ssl_module /usr/lib64/apache2-prefork/mod_ssl.so
LoadModule socache_shmcb_module /usr/lib64/apache2-prefork/mod_socache_shmcb.so
LoadModule userdir_module /usr/lib64/apache2-prefork/mod_userdir.so
LoadModule reqtimeout_module /usr/lib64/apache2-prefork/mod_reqtimeout.so
LoadModule authn_core_module /usr/lib64/apache2-prefork/mod_authn_core.so
LoadModule authz_core_module /usr/lib64/apache2-prefork/mod_authz_core.so
LoadModule php7_module /usr/lib64/apache2-prefork/mod_php7.so
gwain:~ # grep APACHE_MPM /etc/sysconfig/apache2
APACHE_MPM=“”
gwain:~ # vi /etc/sysconfig/apache2
gwain:~ # grep APACHE_MPM /etc/sysconfig/apache2
APACHE_MPM=“”
gwain:~ # vi /etc/sysconfig/apache2
gwain:~ # grep APACHE_MPM /etc/sysconfig/apache2
APACHE_MPM=“prefork”
gwain:~ # service apache2 restart
gwain:~ # ls -l /usr/lib64/apache2-prefork/mod_php7.so
lrwxrwxrwx 1 root root 30 Aug 1 17:31 /usr/lib64/apache2-prefork/mod_php7.so → /usr/lib64/apache2/mod_php7.so
At least PHP documents do open in the Browser now instead of being downloaded.
But still no execution of PHP code.
@Kieltux Any additional hints? As there is still no execution of PHP code
hcvv
September 11, 2023, 10:00am
#13
Please, you seem to use openSUSE15.2. Support stopped on it 2021-12-31. Which means that probably nobody here will will use that anymore and thus can not look in any configuration files or other to compare with what you have with any guarantee of success (and their memory may also be vague of what were the details two to three years ago).
I wonder. You simply start with describing your problem in post #1 above as if you just started using Apache on your 15.2 system. You do not describe that it was already used for a few years before it stopped doing what you expect.
When it is indeed the case that you started this anew on an old 15.2, why not did you first upgrade (or install a fresh) Leap 15.5?
OTOH, when this was running already on your 15.2, why did you not describe what was done/changed before it stopped functioning?
BTW, in both cases, my advice would be to install openSUSE Leap 15.5 and try again. Either it would function from the start, or you can at least ask here to people who use the same as you do.
1 Like
Can I upgrade directly to 15.5 or do I have to do all intermediate steps?
hui
September 11, 2023, 3:01pm
#15
Read:
https://en.opensuse.org/SDB:System_upgrade
Do not skip a release when upgrading! Example: do not upgrade from 15.1 to 15.4. Instead, from 15.1 upgrade to 15.2, then to 15.3, and only then from 15.3 upgrade to 15.4.
hcvv
September 11, 2023, 3:24pm
#16
A new install of 15.5 keeping (or reloading) user data maybe quicker.
Applications might also support upgrading their configuration files and data(-bases) only step by step. Thus users must be prepared to remove their desktop (or other programs) configurations and let them become created new by those applications.