Home  >  Article  >  Backend Development  >  How to compile and install the php extension package curl

How to compile and install the php extension package curl

王林
王林Original
2020-07-30 14:48:262951browse

How to compile and install the php extension package curl: 1. Download the curl compressed package and decompress it; 2. Run phpize; 3. Execute the [make install] command; 4. Edit the php.ini file and add the configuration [extension] =curl.so]; 5. Check whether the installation is successful.

How to compile and install the php extension package curl

php source code directory:/root/php

php compilation directory:/usr/local/webserver/php/

curl source code directory:/root/curl

(Recommended tutorial: php graphic tutorial)

Specific installation process:

1. Download curl

http://curl.haxx.se/download.html

2. Unzip

tar -zxvf curl.tar.gz

3.

cd  /(php源码目录,不是php编译目录)/ext/curl

4. Run phpize

/(php编译目录)/bin/phpize

(Video tutorial recommendation: php video tutorial)

5,

./configure --with-php-config=/(php编译目录)/bin/php-config  --with-curl=/(curl源码目录)

6,

make && make install

7. Modify php.ini and add: extension=curl.so (if no other php extensions have been installed, then You need to configure extension_dir="/(php compiled directory)/lib/php/extensions/no-debug-non-zts-20121212/". When the .so file is generated in the previous step, the extension_dir directory will be output)

8. Check whether the installation is successful

/(php编译后目录)/bin/php -m | grep curl

If curl is printed normally, it means the installation is successful (php -m will print out the installed extension modules).

The above is the detailed content of How to compile and install the php extension package curl. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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