Topic: apache not interpreting/executing PHP after install

I have centos version centos-release-7-6.1810.2.el7.centos.x86_64 and apache 2.4.6 (Centos). I installed the remi repo
remi-safe and epel/x86_64. I then ran this to install PHP 7.3:

sudo yum install php73.x86_64 php73-php-cli.x86_64 php73-php-gd.x86_64 php73-php-json.x86_64 php73-php-ldap.x86_64 php73-php-mbstring.x86_64 php73-php-mysqlnd.x86_64 php73-php-odbc.x86_64 php73-php-pdo.x86_64 php73-php-pdo-dblib.x86_64

If I run php -v I get:

PHP 7.3.2 (cli) (built: Feb  5 2019 13:10:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies

so PHP is installed. But if I try to open a PHP page in the browser, I see the source code. PHP is not being interpreted/executed by apache. What else do I need to do to get apache to recognize the remi PHP?

Thank you!

Re: apache not interpreting/executing PHP after install

You have only installed the CLI SAPI, nothing for the web server

You need

1/ Simple old way: mod_php (php73-php) which works out of the box.

BTW, mod_php only allow a single version, in which case, you don't need the SCL (php73-* packages), but rather the base packages (php-*)

Read: https://blog.remirepo.net/post/2018/12/ … -or-Fedora
and https://blog.remirepo.net/pages/English-FAQ#scl
Also the Wizard instructions (top right link of the page)


2/ Modern way: FPM (php73-php-fpm)

Read: https://developers.redhat.com/blog/2017 … tion-tips/

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 30 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: apache not interpreting/executing PHP after install

I tried method 2 and that fixed it. Thank you SO much!!!

Re: apache not interpreting/executing PHP after install

smile

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 30 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test