To enable PHP on Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module/usr/local/opt/php70/libexec/apache2/libphp7.so
<filesmatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check directoryindex includes index.php
DirectoryIndex index.php index.html
The php.ini file can is found in:
/usr/local/etc/php/7.0/php.ini
???? Extensions????
If you have a issues with a custom extension compiling, ensure that
You is using the brew version, by Placing/usr/local/bin Before/usr/sbin in your PATH:
Path= "/usr/local/bin: $PATH"
PHP70 Extensions'll always be compiled against this PHP. Please install them
Using--without-homebrew-php to enable compiling against system PHP.
???? PHP CLI????
If you wish-to-swap the PHP you use on the command line, you should add the following to ~/.BASHRC,
~/.ZSHRC, ~/.profile or your shell ' s equivalent configuration file:
Export Path= "$ (Brew--prefix homebrew/php/php70)/bin: $PATH"
???? Fpm????
To launch PHP-FPM on startup:
Mkdir-p ~/library/launchagents
Cp/usr/local/opt/php70/homebrew.mxcl.php70.plist ~/library/launchagents/
Launchctl load-w ~/library/launchagents/homebrew.mxcl.php70.plist
The control script is located at/usr/local/opt/php70/sbin/php70-fpm
OS X 10.8 and newer come with PHP-FPM pre-installed, to ensure is using the brew version you need to make sure/usr/l Ocal/sbin is before/usr/sbin in your PATH:
Path= "/usr/local/sbin: $PATH"
Also need to edit the plist to use the correct "UserName".
Please note that the plist is called ' homebrew-php.josegonzalez.php70.plist ' in old versions
of this formula.
To has launchd start homebrew/php/php70 at login:
Ln-sfv/usr/local/opt/php70/*.plist ~/library/launchagents
Then-to-load HOMEBREW/PHP/PHP70 now:
Launchctl Load ~/library/launchagents/homebrew.mxcl.php70.plist
Notice:brew Install Php70