入っていたはずのphpがphp -v
としても
$ php -v dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib Referenced from: /usr/local/bin/php Reason: image not found Abort trap: 6
となってしまうようになりました。
それなら入れようと思い、Homebrewでmacにphpを入れようとしたのですが上手くいきません。
$ brew install php@7.3 Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae Updated 1 formula. Warning: php@7.3 7.3.20 is already installed and up-to-date To reinstall 7.3.20, run `brew reinstall php@7.3`
php7.3はもう入っているよ、と言われ、Warningにあるbrew reinstall php@7.3
を試してみると
$ brew reinstall php@7.3 ==> Downloading https://homebrew.bintray.com/bottles/php%407.3-7.3.20.mojave.bottle.tar.gz Already downloaded: /Users/saya/Library/Caches/Homebrew/downloads/280ac59e4933f37322e0eeba4ed830cf547e52a168556016f46edd55a4c451a9--php@7.3-7.3.20.mojave.bottle.tar.gz ==> Reinstalling php@7.3 ==> Pouring php@7.3-7.3.20.mojave.bottle.tar.gz ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set php_ini /usr/local/etc/php/7.3/php.ini syst ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set php_dir /usr/local/share/pear@7.3 system ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set doc_dir /usr/local/share/pear@7.3/doc syste ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set ext_dir /usr/local/lib/php/pecl/20180731 sy ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set bin_dir /usr/local/opt/php@7.3/bin system ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set data_dir /usr/local/share/pear@7.3/data sys ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set cfg_dir /usr/local/share/pear@7.3/cfg syste ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set www_dir /usr/local/share/pear@7.3/htdocs sy ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set man_dir /usr/local/share/man system ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set test_dir /usr/local/share/pear@7.3/test sys ==> /usr/local/Cellar/php@7.3/7.3.20/bin/pear config-set php_bin /usr/local/opt/php@7.3/bin/php syst ==> /usr/local/Cellar/php@7.3/7.3.20/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/php@7.3/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.3/ php@7.3 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 php@7.3 first in your PATH run: echo 'export PATH="/usr/local/opt/php@7.3/bin:$PATH"' >> /Users/saya/.bash_profile echo 'export PATH="/usr/local/opt/php@7.3/sbin:$PATH"' >> /Users/saya/.bash_profile For compilers to find php@7.3 you may need to set: export LDFLAGS="-L/usr/local/opt/php@7.3/lib" export CPPFLAGS="-I/usr/local/opt/php@7.3/include" To have launchd start php@7.3 now and restart at login: brew services start php@7.3 Or, if you don't want/need a background service you can just run: php-fpm ==> Summary ???? /usr/local/Cellar/php@7.3/7.3.20: 521 files, 77MB ==> `brew cleanup` has not been run in 30 days, running now... Pruned 0 symbolic links and 6 directories from /usr/local Error: Permission denied @ apply2files - /usr/local/lib/node_modules/gulp-cli/node_modules/extglob/lib/.DS_Store
となってしまいます。
一番最後の行で
Error: Permission denied @ apply2files - /usr/local/lib/node_modules/gulp-cli/node_modules/extglob/lib/.DS_Store
とあるので、パーミッションを変更したいのですが
/usr/local/lib/node_modules/gulp-cli/node_modules/extglob/lib/.DS_Store
へcdしたくてもそんなディレクトリはないと言われてしまいます。。
パスが通っていないのかな?と、which php
としてみたら下記のようになっていました。
$ which php /usr/local/bin/php
何がいけないんでしょうか…
心当たりと言えばHomebrewをアップデートしたあたりから、composer -v
もphp -v
もできなくなりました。
何か手がかりをいただけると幸いです。
実行環境: macOS 10.14.6 Mojave
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/01 23:34