Install php extension in MAMP environment

PHP中文网
Release: 2023-02-28 22:00:01
Original
3604 people have browsed it

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
Copy after login

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
Copy after login

. A prompt should be returned, similar to

Install php extension in MAMP environment

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
Copy after login

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 promptedInstall php extension in MAMP environment

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 (m.sbmmt.com)!



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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!