当前位置:网站首页>Compiling and installing phpredis extension on MAC

Compiling and installing phpredis extension on MAC

2022-06-26 04:22:00 Scholar and

Installation steps :
1: download phpredis
Download address :【https://pecl.php.net/package/redis】, Select the required extended version
2: Unzip and download the installation package , And unzip it to get the folder redis-3.1.1RC2( The version I downloaded )
3: Open the command line tool , Enter into redis-3.1.1RC2 Under the table of contents
4: Carry out orders

sudo /Applications/MAMP/bin/php/php7.2.22/bin/phpize

(php The absolute path of the directory where the environment is located )

5: Carry out orders

sudo ./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.22/bin/php-config
sudo make
sudo make install

Finally, the output is successful :

Installing shared extensions:     /Applications/MAMP/bin/php/php7.2.22/lib/php/extensions/no-debug-non-zts-20170718/

Under the above folder , Will generate redis.so file

6: find phpinfo Point to the php.ini file
7: stay php.ini New extension in file

extension=redis.so

notes : Make sure that redis.so Location and extension_dir Pointing to the directory is consistent
8: restart php
9: restart nginx

remarks : If it is an old project that is pulled from the online or copied to the local , Best to confirm phpinfo in redis Extended version number , The compiled version shall be consistent with the online version number , Otherwise, compatibility problems may occur ,

原网站

版权声明
本文为[Scholar and]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180533333802.html