Home  >  Article  >  Backend Development  >  Install PHP curl extension in Linux

Install PHP curl extension in Linux

藏色散人
藏色散人Original
2020-08-15 10:08:302420browse

How to install the php extension curl on Linux: first enter the PHP source code directory; then call the phpize program to generate the compilation configuration file; then call configure to generate the Makefile file; and finally compile and install it.

Install PHP curl extension in Linux

# Recommended: "

PHP Video Tutorial

I encountered such a problem during development today, that is, how to install the curl extension of PHP under Linux. My LNMP environment was originally compiled and installed, not installed using YUM. of.

My environment:

Linux: CentOs 6.4
PHP: 5.6.30

Solution:

1. Enter the PHP source code directory, where you downloaded PHP to Server and decompressed address

cd /usr/local/src/php-5.6.30

2. Perform ext/curl

cd ext/curl

in the PHP source directory. 3. Call the phpize program to generate the compilation configuration file

/usr/local/php/bin/phpize

4. Call configure Generate Makefile

./configure --with-curl=/usr/local/curl --with-php-config=/usr/local/php/bin/php-config

5. Compile and install

make & make install

You will be prompted for the path to generate the file curl.so:

/usr/local/php/ lib/php/extensions/no-debug-non-zts-20131226/

6. Modify the php.ini file

vim /usr/local/php/lib/php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/curl.so

7. Detect

/usr/local/php/bin/php -m

if Seeing a curl item indicates a successful installation

8. Restart php-fpm

pkill -9 php-fpm./sbin/php-fpm

OK!

The above is the detailed content of Install PHP curl extension in Linux. 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