I use php7.1 in my linux:
I can check it:
# php -v
PHP 7.1.16 (cli) (built: Jun 25 2018 08:12:28) ( ZTS )
so in my http.conf
, I add the module:
LoadModule php7_module modules/libphp7.so
Then I restart the apache
by ./apachectl restart
, there I get the bellow error:
httpd: Syntax error on line 154 of /usr/local/httpd/conf/httpd.conf: Cannot load modules/libphp7.so into server: /usr/local/httpd/modules/libphp7.so: cannot open shared object file: No such file or directory
2
Answers
You need to install Apache’s SAPI for PHP.
Install the following packet: php-apache
Then restart your httpd server.
I putting this here, so it might help someone. by using this you can install any version of php7.x
This is process to install apache and php7.1 on Centos7
Apache instalaltion
PHP 7 rpm (which also include php7.1, php7.2 php7.3 php7.4)
use remi-php71 for php7.1 or remi-php72 or remi-php73 or remi-php74 for other php7.x version
It will install php version from above enabled repo
This will automatically put libphp7.so file in module folder and solve above problem in question