How to install php7.1 memcache extension on mac

青灯夜游
Release: 2023-04-05 18:08:01
forward
2843 people have browsed it

The content of this article is to introduce the method of installing php7.1 memcache extension on mac. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

1. Download the memcache source code file

https://github.com/websupport-sk/pecl-memcache/archive/php7.zip

The folder name is :pecl-memcache-php7

2. After decompression, enter the folder and execute the following command

phpize
Copy after login

I encountered this error when executing phpize

$ phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:        
Zend Module Api No:     
Zend Extension Api No:
Copy after login

The header file of PHP is missing. , then look at the /usr/include folder and type the following command:

$ xcode-select --install
xcode-select: note: install requested for command line developer tools
Copy after login

If phpize is still invalid, execute the following command to install the header file SDK:

$ cd /Library/Developer/CommandLineTools/Packages/$ open macOS_SDK_headers_for_macOS_10.14.pkg
Copy after login

./ configure --with-php-config=/usr/local/opt/php\@7.1/bin/php-config

Change php-config to the specified path

which php-config
Copy after login

3. Execute make & make install command

4. Configure php.ini and add the following statement:

extension="memcache.so"
Copy after login

where php.ini path

/private/etc/php.ini
Copy after login

Related videos Tutorial recommendation: "PHP Tutorial"

The above is the entire content of this article, I hope it will be helpful to everyone's learning. For more exciting content, you can pay attention to the relevant tutorial columns of the PHP Chinese website! ! !

The above is the detailed content of How to install php7.1 memcache extension on mac. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!