You are not logged in.

#1 2021-03-27 19:38:55

arch251
Member
Registered: 2021-03-20
Posts: 8

(Solved) Apache Cannot Load modules/libphp7.so Into Server

I am having a problem with apache being about to load php into the server and serve basic webpages (such as info.php) to localhost.

systemctl status apache
systemd[1]: Started Apache Web Server
httpd [1444]: httpd: Syntax error on line 542 of /etc/httpd/conf/httpd.conf: Cannot load modules/libphp7.so into server: /etc/
systemd[1]: httpd.service Main process exited, code=exited, status=1/FAILURE
systemd[1]: httpd.service Failed with result 'exit-code'.

In my /etc/httpd/conf/httpd.conf file:

 LoadModule php_module modules/libphp7.so
AddHandler php7-script php
Include conf/extra/php7_module.conf

I am thinking that I may be referencing the wrong php version or I do not have the correct php version installed from the AUR.

If someone could point me in the right direction, I would be grateful.

Last edited by arch251 (2021-03-27 20:53:44)

Offline

#2 2021-03-27 19:54:26

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

pacman -F libphp7.so

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-03-27 20:12:20

arch251
Member
Registered: 2021-03-20
Posts: 8

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

jasonwryan wrote:
pacman -F libphp7.so

I tried this and the error persists.

localhost/index.html works fine ...
localhost/info.php gives me the error "cannot load modules/libphp7.so into server".

The current version of php I am using is php-8.0.3-1 and also php-apache-8.0.3-1

Perhaps I need to change which php module is being referenced with the LoadModule command to php8?

Last edited by arch251 (2021-03-27 20:22:11)

Offline

#4 2021-03-27 20:40:51

arch251
Member
Registered: 2021-03-20
Posts: 8

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

Here is what I currently have installed for php:

  • php-8.0.3-1

  • php-cgi-8.0.3-1

  • php-gd-8.0.3-1

  • php-pgsql-8.0.3-1

Offline

#5 2021-03-27 20:53:15

arch251
Member
Registered: 2021-03-20
Posts: 8

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

So it turns out this may just be a change in naming conventions from the PHP team (https://bugs.php.net/bug.php?id=78681).

My solution came where I simply changed /libphp7.so to /libphp.so and similar references as well. It seems with php8 they changed the naming conventions to remove the version number from the module reference:

 LoadModule php_module modules/libphp.so
AddHandler php-script php
Include conf/extra/php_module.conf

Hopefully this is a long-term solution.

Last edited by arch251 (2021-03-27 20:54:50)

Offline

#6 2021-05-21 16:59:53

Erof
Member
Registered: 2020-10-10
Posts: 2

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

Yes, thanks arch251, worked for me too.

Offline

#7 2022-12-24 12:31:38

ShailMurtaza
Member
From: Pakistan
Registered: 2022-12-23
Posts: 4
Website

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

You don't have php7 installed.
If you have installed PHP then you must have the latest version of PHP
Just replace "php7" everywhere with just "php"


Yo!

Offline

#8 2022-12-24 13:05:07

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: (Solved) Apache Cannot Load modules/libphp7.so Into Server

Please do not necrobump, ShailMurtaza.

https://wiki.archlinux.org/title/Genera … bumping%22

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB