å称 | æ¦è¦ |
---|---|
å®è¡æ¥ | 2017/08/20 |
OS | MacOS Sierra |
Apache | 2.4.27 |
Brew | Homebrew 1.3.1 |
$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/php
$ brew tap homebrew/apache
$ brew update
-- ä¸è¦ãªãå¤ã
$ brew unlink php56
$ brew install php71 --with-httpd24
-- æ®æ®µCakePHPãããå©ç¨ããã®ã§ã¤ãã§ã«æé å
$ brew install php71-intl php71-pdo-pgsql
$ sudo vi /etc/apache2/httpd.conf
-- 以ä¸ã®å¤æ´--
# LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php7_module /usr/local/opt/php71/libexec/apache2/libphp7.so
-------------
$ sudo vi /etc/apache2/other/php7.conf
--- 以ä¸ã追å ---
SetHandler application/x-httpd-php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php
---------------
sudo mv /etc/apache2/other/php5.conf /etc/apache2/other/php5.conf.bk
-- versionãã§ãã¯
$ php -v
$ sudo apachectl restart
åºæ¬ã¯ããã§è¡ããã¯ãã§ãã、èªåã®ç°å¢ã§ã¯è¡ãã以ä¸ã対å¿
less /var/log/apache2/error_log
---- ã¨ã©ã¼ãã°ããã§ã㯠-----
[Sun Aug 20 20:53:25.102393 2017] [mpm_prefork:notice] [pid 86] AH00163: Apache/2.4.25 (Unix) PHP/7.1.8 configured -- resuming normal operations
[Sun Aug 20 20:53:25.102609 2017] [core:notice] [pid 86] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
---------------------------
php.iniãå¤ãã®ãåé¡ã®å¯è½æ§ãé«ã
php5.6ããphp7.1åãã®php.iniãå ¬å¼ãµã¤ãããphp-7.1.8.tar.bz2ãDLã
Downloadãã©ã«ãã«è§£åå¾ä»¥ä¸ãå®æ½
sudo mv /etc/php.ini /etc/php.ini.20170820
sudo cp Downloads/php-7.1.8/php.ini-production /etc/php.ini
ããã§è¡ãã¾ãã。