Configure PHP CURL in Linux environment

(1) First, go to the directory where you downloaded the decompressed PHP, and do the following:
cd php-5.6.14
cd ext/
cd curl/
/usr/local/php/bin/phpize ./configure --with-curl=DIR
./configure --with-php-config=/usr/local/php/bin/php-config --with-curl=DIR
make
make install


(2) After installation, you will be prompted
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

You can see it after entering the directory

curl.so  opcache.so


You can copy the above two so files to the extension_dir directory of php, usually ****/lib/php/extensions

(3) Check and modify php.ini

to check whether the extension_dir configuration of php.ini is correct

and then add the following two
extension=curl.so
extension=opcache.so


(4) Use phpinfo() to check whether the installation is successful.
You can see the following:
cURL support enabled
cURL Information 7.15.5

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326945189&siteId=291194637