How to install extensions for PHP that comes with Mac

王林
Release: 2023-02-27 16:58:01
Original
7899 people have browsed it

How to install extensions for PHP that comes with Mac

This article takes mongodb extension as an example.

System: MacOS 10.12.6

Installation steps:

1. Download the expansion package

2. Preparation Working (please skip this step if autoconf and openssl are already installed):

brew install autoconf
brew install openssl

echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
Copy after login

3. Unzip and enter:

/Applications/MxSrvs/bin/php/bin/phpize
./configure --with-php-config=/Applications/MxSrvs/bin/php/bin/php-config 
--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2r
make && make install
Copy after login

How to install extensions for PHP that comes with Mac

4. Edit php.ini and add the mongodb extension in the extension area

extension=/Applications/MxSrvs/bin/php/lib/php/extensions/no-debug-non-zts-20131226/mongo.so
Copy after login

5. View phpinfo()

How to install extensions for PHP that comes with Mac

Recommended tutorial: PHP video tutorial

The above is the detailed content of How to install extensions for PHP that comes with Mac. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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