Created
August 30, 2022 07:41
-
-
Save timogoosen/8a13501aa8e4fed5e8f4daaa8949ba35 to your computer and use it in GitHub Desktop.
Setup php7.4 Mac OSX alongside php7.3
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 shivammathur/php/[email protected] | |
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" | |
pecl install igbinary | |
pecl install redis | |
pecl install imagick | |
brew services restart [email protected] | |
curl -sS https://getcomposer.org/installer | php -- --version=1.10.16 | |
sudo mkdir -p /usr/local/bin | |
sudo mv composer.phar /usr/local/bin/composer2 | |
sudo chmod u+x /usr/local/bin/composer2 | |
sudo chown root:wheel /usr/local/bin/composer2 | |
composer2 --version | |
If you run into any issues with extensions being loaded double then check this config file: | |
vim /opt/homebrew/etc/php/7.4/php.ini | |
You might see extensions loaded twice like: | |
extension=redis.so | |
extension=redis.so | |
Just comment those out |
If you run into:
checking for igbinary includes... configure: error: Cannot find igbinary.h
ERROR: `/private/tmp/pear/temp/redis/configure --with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config --enable-redis-igbinary=yes --enable-redis-lzf=yes --enable-redis-zstd=yes' failed
Then try run
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
pecl install redis
But then don't enable igbinary support when prompted during pecl install redis.
Change port number here:
vim /opt/homebrew/etc/php/7.4/php-fpm.d/www.conf
This is the line to change:
# From:
# listen = 127.0.0.1:9000
# To below:
listen = 127.0.0.1:9075
Then restart service:
brew services restart [email protected]
Then:
$ lsof -i | grep php
php-fpm 95920 timo 9u IPv4 0x8723fd3d358a72ad 0t0 TCP localhost:9075 (LISTEN)
php-fpm 95925 timo 10u IPv4 0x8723fd3d358a72ad 0t0 TCP localhost:9075 (LISTEN)
php-fpm 95926 timo 10u IPv4 0x8723fd3d358a72ad 0t0 TCP localhost:9075 (LISTEN)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extensions should be installed here:
$ ls /opt/homebrew/lib/php/pecl/20190902/
PhpStorm.app igbinary.so imagick.so redis.so