Yohanes AI
Yohanes AI

Reputation: 3621

Install PHP 7.2 on Centos 7

I following this link to upgrade my php from 5.6 to 7.2 and its successfully installed

PHP 7.2.14 (cli) (built: Jan  8 2019 12:06:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.14, Copyright (c) 1999-2018, by Zend Technologies

here my httpd

Server version: Apache/2.4.6 (CentOS)
Server built:   Nov  5 2018 01:47:09

after trying to phpinfo() I got apache doesn't works. Its produce php code rather than compiling.

I check my httpd.conf, there are no LoadModule for php7Module. So I add LoadModule as bellow

LoadModule php7_module modules/libphp7.so
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

and checking libphp7.so and guess what, there are no libphp7.so at modules directory.

However, I still figuring out what I miss. I install bellow dependencies

php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json

Ps. I running CentOS Linux release 7.6.1810 (Core)

Update 1

getsebool -a | egrep 'cgi|builtin_scriptin'
httpd_builtin_scripting --> on
httpd_enable_cgi --> on

I think that PHP isn't enabled in Apache. How to make it works?

Upvotes: 0

Views: 3504

Answers (1)

Santhosh Kumar
Santhosh Kumar

Reputation: 543

Try to restart/start apache2

sudo systemctl restart httpd.service

If still issue persists, then

sudo systemctl status httpd.service

Upvotes: 1

Related Questions