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.

Sam
  • 1,129
  • 2
  • 10
  • 24

3 Answers3

34

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.

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

Eerik Sven Puudist
  • 2,098
  • 2
  • 23
  • 42
Script Host
  • 911
  • 1
  • 11
  • 22
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