0

Hello i wanna run a server for my php application on apache2, but when i try to download apache2 like it sais on this website https://www.digitalocean.com/community/tutorials/how-to-install-lamp-stack-on-ubuntu i get the following error message. Can someone help me? i looked online for a bit and thought maybe its my php version because a lot of people having issues with that, but my php version is 8.1.2. So i dont think thats the problem,

apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/access_compat.load: Cannot load /usr/lib/apache2/modules/mod_access_compat.so into server: /usr/lib/apache2/modules/mod_access_compat.so: cannot open shared object file: No such file or directory
apr 12 17:13:03 kemal-server apachectl[30890]: Action 'start' failed.

in my apache2.conf i get the error message on this code line: IncludeOptional mods-enabled/*.load

and when i go the following path: etc/apache2/mods-enabled/access_compat.load. the file contains this: Depends: authn_core LoadModule access_compat_module /usr/lib/apache2/modules/mod_access_compat.so

So i went and checked if the file exicst and it does, now i cant read it because i think .so was a binary file so i didnt knew how to get further. I tried to reinstall apach2, also tried to reinstall the lib but no luck

edit: i tried to do sudo apt-get install --reinstall apache2 apache2-bin and now i get the error

apr 12 18:14:07 kemal-server systemd[1]: Starting The Apache HTTP Server...
apr 12 18:14:07 kemal-server apachectl[46750]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php8.1.load: Cannot load /usr/lib/apache2/modules/libphp8.1.so into server: /usr/lib/apache2/modules/libphp8.1.so: cannot open shared object file: N>
apr 12 18:14:07 kemal-server apachectl[46747]: Action 'start' failed.
apr 12 18:14:07 kemal-server apachectl[46747]: The Apache error log may have more information.
apr 12 18:14:07 kemal-server systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
apr 12 18:14:07 kemal-server systemd[1]: apache2.service: Failed with result 'exit-code'.
apr 12 18:14:07 kemal-server systemd[1]: Failed to start The Apache HTTP Server.

2
  • check if you have all libraries of the file which cannot be loaded: ldd /usr/lib/apache2/modules/libphp8.1.so should give you a list, if there is a "not found" you need to install that as well. Commented Apr 12 at 17:29
  • please amend your question with ls -l /etc/apache/mods-enabled. Commented Apr 19 at 22:01

1 Answer 1

0

Looks like messed up install. Try to install again MySQL MariaDB dependencies and enable apache php module:

sudo apt install php libapache2-mod-php php-mysql
sudo a2enmod php8.1
sudo systemctl restart apache2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .