[CentOS] Apache shows PHP code instead of executing it

Wed Jan 6 18:25:45 UTC 2021
Kaushal Shriyan <kaushalshriyan at gmail.com>

On Wed, Jan 6, 2021 at 11:49 PM Alexander Dalloz <ad+lists at uni-x.org> wrote:

> Am 06.01.2021 um 19:10 schrieb Kaushal Shriyan:
> > On Wed, Jan 6, 2021 at 9:48 PM Christopher Wensink <
> > cwensink at five-star-plastics.com> wrote:
> >
> >> Does the file have execute permissions, what is the file's permissions
> >> and is it owned by the user running apache?
> >>
> >> Chris
> >>
> > Hi Chris,
> >
> > I have added the below in /etc/httpd/conf/httpd.conf. The issue still
> > persists.
> >
> > <FilesMatch \.php$>
> > SetHandler application/x-httpd-php
> > </FilesMatch>
> >
> > #apachectl -M | grep -i PHP does not return anything
>
> Configure php-fpm.
>
> https://www.stephenrlang.com/2018/02/centos-7-apache-2-4-with-php-fpm/
>
> might help to find the right path to do so.
>
> Alexander
>

Hi Alexander,

Thanks for sharing the link
https://www.stephenrlang.com/2018/02/centos-7-apache-2-4-with-php-fpm/ I
followed and it worked like a charm. Thanks a lot and much appreciated.

Best Regards,