Michelle
Michelle

Reputation: 135

Add PHP to apache on mac os?

I tried to upgrade php 5.6 to php 7, but I caused there a error with trying of this method: https://coolestguidesontheplanet.com/upgrade-php-on-osx/ now I uninstalled this and tried to install php 7 over brew, it works but is still not added to apache, in browser I see still only pure php code.

I tried also to add this line to httpd.conf but no changes:

LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so

the path is correct, knows someone how can I solve this?

Upvotes: 0

Views: 933

Answers (1)

Jirka Hrazdil
Jirka Hrazdil

Reputation: 4021

You may need to add the following declaration to httpd.conf for Apache to parse PHP files via php7_module:

 AddType application/x-httpd-php .php

Restarting of Apache may also be required for the new settings to take effect.

Upvotes: 2

Related Questions