Home > Article > Backend Development > Install php extension in MAMP environment
Installing php extensions in MAMP environment
When installing PHP extensions, you will immediately think of using phpize. You can find good tutorials by just searching online. However, I understand the truth, so why did it only take me a few hours?
1. Go to php.net to download the source code of the corresponding version and put it in
/Application/MAMP/bin/php/php5.6.10/include/php
2. Enter the corresponding extension directory and run phpize
$cd /Application/MAMP/bin/php/php5.6.10/include/php/ext/pcntl$/Applications/MAMP/bin/php/php5.6.10/bin/phpize
. A prompt should be returned, similar to
3. It can be compiled ./configure --with-php-c/MAMP/bin/php/php5.6.10/bin/php-config
–with-php-config points to php-config in the currently used php version, if this path is wrong , even if the compilation is successful, it cannot be used.
4. It seems to be relatively smooth: make && make install
.
Then the problem comesfatal error: 'zend_config.h' file not found
.
I searched the entire computer directly: find / -name ‘zend_config.h’ but couldn’t find this file. I finally found it from the Internet. Then an error fatal error: 'conf.w32.h' file not found
was reported.
After searching for a while, I found the problem: MAMP deleted all these header files... You need to take one more step:
$cd /Applications/MAMP/bin/php/php5.6.10/include/php/$./configure
It prompts that the path of icov is not specified, just add –without-icov, as long as ./configure succeeds That's it, you don't need make && make install.
Now go through steps 3 and 4 again. If the compilation is successful, you should be prompted
Finally, add extension=pcntl.so to php.ini, restart apache, and you're done.
The above is the content of installing php extensions in the MAMP environment. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!