Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Why does switching php versions from 56 to 71 in httpd.conf give me a 403 access denied error? (MacOS localhost) Recently installed php71 on my local test environment. I have an index.php

@Samaraweera270

Posted in: #Apache2 #HttpdConf #Php

Recently installed php71 on my local test environment.

I have an index.php file with phpinfo() in the web root directory.

When I LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so, index.php renders correctly, reporting the expected php version.

Alternatively, LoadModule php7_module /usr/local/opt/php71/libexec/apache2/libphp7.so gives a 403 forbidden message.

This is the same for all of my local web root directories. They render correctly in their entirety when using php5.6, and give me a 403 error when using php7.1.

Do php versions interpret httpd-vhosts.conf differently?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Php7.1 requires the following addition to httpd.conf

SetHandler application/x-httpd-php

When reverting back to php5.6, that line must be commented out, or again, the php code will not be interpreted.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme