Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
Apache2 won't start after upgrade to Ubuntu 22.04 LTS - Cannot load /usr/lib/apache2/moduleslibphp8.0.so

I am a bit stuck as to how to fix this. I did a distro upgrade a server running Apache2.

Since the upgrade it has not worked. I ran a config test and below is the error. I had no issues with my configuration on the previous version of Ubuntu (21.10)

$ apache2ctl configtest
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php8.0.load: Cannot load /usr/lib/apache2/modules/libphp8.0.so into server: /usr/lib/apache2/modules/libphp8.0.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

Any ideas where to begin? I'm still fairly inexperienced when it comes to Apache.

Thank you for your help.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

While you've figured this out, others will come (like myself) to see how you did this.

# perhaps you did the following to see what modules were present
> apache2ctl -M

# the result of the above command may have returned an error such as:
apache2:
 Syntax error on line 146 of /etc/apache2/apache2.conf:
  Syntax error on line 2 of /etc/apache2/mods-enabled/php8.0.load:
   Cannot load /usr/lib/apache2/modules/libphp8.0.so into server:
    /usr/lib/apache2/modules/libphp8.0.so:
     cannot open shared object file: No such file or directory
Action '-M' failed.

# so you removed the problematic module that was no longer installed
# by doing the following (as appropriate given the error above)
> sudo a2dismod php8.0

# you needed to restart your server after that
> sudo systemctl restart apache2

# if you tested the server in a browser html should function...
# however you perhaps desired the use of another php module
# and added another one (8.1) that is install by default in Ubuntu 22.04
> sudo a2enmod php8.1

# you restarted apache again and it worked?
> sudo systemctl restart apache2

Perhaps you were using mod_userdir and also needed to update the apache php module configuration file:

/etc/apache2/mods-enabled/php8.1.conf

By commenting out the following lines:

<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
        php_admin_flag engine Off
    </Directory>
</IfModule>

So that they looked like this:

#<IfModule mod_userdir.c>
#    <Directory /home/*/public_html>
#        php_admin_flag engine Off
#    </Directory>
#</IfModule>
# finally you restarted apache2 again:
sudo systemctl restart apache2
# and everything was back to normal?

Did you do something like this?

over 4 years ago · Santiago Trujillo Relatório

0

Disregard everyone. I figured it out.

I checked /usr/lib/apache2/modules/ and found that libphp8.0.so had been updated to libphp8.1.so.

After amending the mods-enabled to include this file and not the problematic one, apache started with no issues.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda