Last active
May 19, 2018 17:47
-
-
Save ishikawam/663fdf9b32c9729d0963b3600e35eea0 to your computer and use it in GitHub Desktop.
homebrew/phpがdeprecatedになってしまった件 ref: https://qiita.com/M_Ishikawa/items/e8e6081ca2897bb266eb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% brew link php71 | |
Warning: [email protected] is keg-only and must be linked with --force | |
Note that doing so can interfere with building software. | |
If you need to have this software first in your PATH instead consider running: | |
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc | |
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc | |
% php -v | |
PHP 7.0.29 (cli) (built: Apr 12 2018 03:13:39) ( NTS ) | |
Copyright (c) 1997-2017 The PHP Group | |
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies | |
with Zend OPcache v7.0.29, Copyright (c) 1999-2017, by Zend Technologies | |
% brew unlink php70 | |
Unlinking /usr/local/Cellar/[email protected]/7.0.29_1... 25 symlinks removed | |
% brew link php71 | |
Warning: [email protected] is keg-only and must be linked with --force | |
Note that doing so can interfere with building software. | |
If you need to have this software first in your PATH instead consider running: | |
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc | |
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc | |
% php -v | |
PHP 5.6.30 (cli) (built: Oct 29 2017 20:30:32) | |
Copyright (c) 1997-2016 The PHP Group | |
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies | |
% brew link --force php71 | |
Linking /usr/local/Cellar/[email protected]/7.1.14_25... 17 symlinks created | |
If you need to have this software first in your PATH instead consider running: | |
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc | |
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc | |
% php -v | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so' - dlopen(/usr/local/opt/php71-intl/intl.so, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib | |
Referenced from: /usr/local/opt/php71-intl/intl.so | |
Reason: image not found in Unknown on line 0 | |
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so' - dlopen(/usr/local/opt/php71-intl/intl.so, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib | |
Referenced from: /usr/local/opt/php71-intl/intl.so | |
Reason: image not found in Unknown on line 0 | |
PHP 7.1.14 (cli) (built: Feb 2 2018 08:41:46) ( NTS ) | |
Copyright (c) 1997-2018 The PHP Group | |
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% brew install php71 php71-mcrypt php71-intl php71-memcached | |
Error: No available formula with the name "php71-mcrypt" | |
==> Searching for a previously deleted formula (in the last month)... | |
Warning: homebrew/core is shallow clone. To get complete history run: | |
git -C "$(brew --repo homebrew/core)" fetch --unshallow | |
Error: No previously deleted formula found. | |
==> Searching for similarly named formulae... | |
==> Searching local taps... | |
Error: No similarly named formulae found. | |
==> Searching taps... | |
==> Searching taps on GitHub... | |
Error: No formulae found in taps. | |
brew install php71 php71-mcrypt php71-intl php71-memcached 2.29s user 0.94s system 62% cpu 5.131 total |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% brew search php71 | |
==> Searching local taps... | |
==> Searching taps on GitHub... | |
==> Searching blacklisted, migrated and deleted formulae... | |
It was migrated from homebrew/php to homebrew/core. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% brew install [email protected] | |
Updating Homebrew... | |
==> Downloading https://homebrew.bintray.com/bottles/[email protected]_1.sierra.bottle.tar.gz | |
Already downloaded: /Users/masayuki.ishikawa/Library/Caches/Homebrew/[email protected]_1.sierra.bottle.tar.gz | |
==> Pouring [email protected]_1.sierra.bottle.tar.gz | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set php_ini /usr/local/etc/php/7.1/php.ini system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set php_dir /usr/local/share/[email protected] system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set doc_dir /usr/local/share/[email protected]/doc system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set ext_dir /usr/local/lib/php/pecl/20160303 system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set bin_dir /usr/local/opt/[email protected]/bin system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set data_dir /usr/local/share/[email protected]/data system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set cfg_dir /usr/local/share/[email protected]/cfg system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set www_dir /usr/local/share/[email protected]/htdocs system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set man_dir /usr/local/share/man system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set test_dir /usr/local/share/[email protected]/test system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear config-set php_bin /usr/local/opt/[email protected]/bin/php system | |
==> /usr/local/Cellar/[email protected]/7.1.16_1/bin/pear update-channels | |
==> Caveats | |
To enable PHP in Apache add the following to httpd.conf and restart Apache: | |
LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so | |
<FilesMatch \.php$> | |
SetHandler application/x-httpd-php | |
</FilesMatch> | |
Finally, check DirectoryIndex includes index.php | |
DirectoryIndex index.php index.html | |
The php.ini and php-fpm.ini file can be found in: | |
/usr/local/etc/php/7.1/ | |
This formula is keg-only, which means it was not symlinked into /usr/local, | |
because this is an alternate version of another formula. | |
If you need to have this software first in your PATH run: | |
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc | |
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc | |
For compilers to find this software you may need to set: | |
LDFLAGS: -L/usr/local/opt/[email protected]/lib | |
CPPFLAGS: -I/usr/local/opt/[email protected]/include | |
To have launchd start [email protected] now and restart at login: | |
brew services start [email protected] | |
Or, if you don't want/need a background service you can just run: | |
php-fpm | |
==> Summary | |
🍺 /usr/local/Cellar/[email protected]/7.1.16_1: 514 files, 67MB | |
brew install [email protected] 3.84s user 4.29s system 63% cpu 12.835 total | |
% php -v | |
PHP 5.6.30 (cli) (built: Oct 29 2017 20:30:32) | |
Copyright (c) 1997-2016 The PHP Group | |
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% export PATH="/usr/local/opt/[email protected]/bin:$PATH" | |
% export PATH="/usr/local/opt/[email protected]/sbin:$PATH" | |
% php -v | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-igbinary/igbinary.so' - dlopen(/usr/local/opt/php71-igbinary/igbinary.so, 9): image not found in Unknown on line 0 | |
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-igbinary/igbinary.so' - dlopen(/usr/local/opt/php71-igbinary/igbinary.so, 9): image not found in Unknown on line 0 | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so' - dlopen(/usr/local/opt/php71-intl/intl.so, 9): image not found in Unknown on line 0 | |
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so' - dlopen(/usr/local/opt/php71-intl/intl.so, 9): image not found in Unknown on line 0 | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php71-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0 | |
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php71-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0 | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-memcached/memcached.so' - dlopen(/usr/local/opt/php71-memcached/memcached.so, 9): image not found in Unknown on line 0 | |
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-memcached/memcached.so' - dlopen(/usr/local/opt/php71-memcached/memcached.so, 9): image not found in Unknown on line 0 | |
PHP 7.1.16 (cli) (built: Apr 12 2018 03:25:50) ( NTS ) | |
Copyright (c) 1997-2018 The PHP Group | |
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies | |
with Zend OPcache v7.1.16, Copyright (c) 1999-2018, by Zend Technologies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ll /usr/local/etc/php/7.1/conf.d/ | |
total 48 | |
drwxr-xr-x 7 masayuki.ishikawa admin 238B 4 25 16:07 ./ | |
drwxr-xr-x 11 masayuki.ishikawa admin 374B 4 25 15:16 ../ | |
-rw-r--r-- 1 masayuki.ishikawa admin 300B 2 5 11:04 ext-igbinary.ini | |
-rw-r--r-- 1 masayuki.ishikawa admin 303B 2 28 16:40 ext-intl.ini | |
-rw-r--r-- 1 masayuki.ishikawa admin 59B 2 28 16:40 ext-mcrypt.ini | |
-rw-r--r-- 1 masayuki.ishikawa admin 4.0K 2 5 11:04 ext-memcached.ini | |
-rw-r--r-- 1 masayuki.ishikawa admin 76B 4 25 16:07 ext-opcache.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% rm -rf /usr/local/etc/php/7.1/conf.d/* | |
zsh: sure you want to delete all the files in /usr/local/etc/php/7.1/conf.d [yn]? y | |
% php -v | |
PHP 7.1.16 (cli) (built: Apr 12 2018 03:25:50) ( NTS ) | |
Copyright (c) 1997-2018 The PHP Group | |
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment