philcook / brew-php-switcher

Brew PHP switcher is a simple shell script to switch your apache and CLI quickly between major versions of PHP. If you support multiple products/projects that are built using either brand new or old legacy PHP functionality. For users of Homebrew (or brew for short) currently only.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Won't execute PHP scripts in PHP70

JohnnyWalkerDigital opened this issue · comments

But PHP56 works fine.

Not sure what's going on. brew doctor is happy. php --ini shows:

Configuration File (php.ini) Path: /usr/local/etc/php/7.0
Loaded Configuration File:         /usr/local/etc/php/7.0/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.0/conf.d/ext-mcrypt.ini

But .php files themselves aren't executed and just show code in the browser. If I switch back to PHP56 they work fine.

Turns out I needed to add a line to httpd.conf:

AddType application/x-httpd-php .php

Strangely this wasn't needed for PHP56.