Home  >  Article  >  Backend Development  >  How to install php_curl in linux

How to install php_curl in linux

藏色散人
藏色散人Original
2021-06-16 10:38:522450browse

How to install php_curl in Linux: 1. Find the curl extension directory in the PHP installation package, then run phpize and compile and install; 2. Execute the "sudo apt-get install php5-curl" command.

How to install php_curl in linux

The operating environment of this article: centOS6.8 system, php5.6.14 version, DELL G3 computer

How to install php_curl in Linux?

1.CentOS system

php installation package directory:/data/php5.6.14/

PHP installation path:/usr/local/php/

(The specific path settings in the following steps can be set according to your actual situation.)

Find the curl extension directory in the PHP installation package

cd /data/php5.6.14/ext/curl/

Run phpize

/usr/local/php/bin/phpize

Compile and install:

./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

At this time curl.so has been generated in the /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ directory

Set the PHP configuration file php.ini, add the following line

extension=curl.so

Finally restart the service and use phpinfo() to check whether the PHP-curl extension is installed successfully.

2.Ubuntu system

You can install it directly through the following command.

sudo apt-get install php5-curl

Finally restart the service.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to install php_curl 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