Home > Backend Development > PHP Problem > How to install php_curl in linux

How to install php_curl in linux

藏色散人
Release: 2023-03-10 16:20:02
Original
2502 people have browsed it

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

Run phpize

/usr/local/php/bin/phpize
Copy after login

Compile and install:

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

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

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

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!

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