13

I have Install php 7.3 and apache2 but when I try to start apache2 , I have this error :

service apache2 start

apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.3.load: Cannot load /usr/lib/apache2/modules/libphp7.3.so into server:   /usr/lib/apache2/modules/libphp7.3.so: cannot open shared object file: No such file or directory

I really don't know how to resolve this problem, I have tried to remove and reinstall without success.

4 Answers 4

35

You're getting that error because the PHP 7.3 library for Apache is not installed.

sudo apt install -y libapache2-mod-php7.3

The above command should fix it.

2
  • Actually this is the exact solution for missing /usr/lib/apache2/modules/libphp7.3.so file Commented Mar 26, 2021 at 11:39
  • Agreed. This is the correct answer.
    – Jomenuke
    Commented Mar 13, 2023 at 17:05
8

It solved my problem:

  1. sudo add-apt-repository ppa:ondrej/php

  2. sudo apt-get update

  3. sudo apt-get install php7.3

  4. sudo apt-get install php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-mysql php7.3-mbstring php7.3-zip php7.3-fpm php7.3-intl php7.3-simplexml

  5. sudo service apache2 restart

1

For me the problem was that I did not install apache tools for php. On arch linux:

yaourt -S php-apache

After that, module appeared in the folder.

The best way not to make a mistake is to follow guide: https://wiki.archlinux.org/title/Apache_HTTP_Server#PHP

-1

Just copy the .so file from anotherplace

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.