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

How to compile and install the php extension package curl

王林
Release: 2023-03-03 14:50:02
Original
2993 people have browsed it

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

2. Unzip

tar -zxvf curl.tar.gz
Copy after login

3.

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

4. Run phpize

/(php编译目录)/bin/phpize
Copy after login

(Video tutorial recommendation: php video tutorial)

5,

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

6,

make && make install
Copy after login

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

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!

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