I am on Ubuntu 22.04. I recently upgraded PHP from 7.4 to 8.1
PHP version:
PHP 8.1.2-1ubuntu2.8 (cli) (built: Nov 2 2022 13:35:25) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.8, Copyright (c), by Zend Technologies
Apache version:
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2022-06-14T12:30:21
When running the following command,
$ sudo service apache2 restart
I am getting this:
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
Running apachectl configtest
gives me the following:
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load /usr/lib/apache2/modules/libphp7.4.so into server: /usr/lib/apache2/modules/libphp7.4.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
I looked inside /etc/apache2/mods-enabled/
folder, but there is no module for PHP 8.1. I can only see php7.4.load
.
What is the correct way to resolve this problem? Looks like I am missing the module, but don't know how to install it and go ahead with further configuration.
Please suggest!