Install and turn on Curl Extensions for PHP

Source: Internet
Author: User
Tags php source code

Installing some PHP source code such as Cmstop needs the system to turn on the curl extension, which needs to modify the PHP configuration, in Windows only three simple steps.

One, window under the installation of Php_curl support

1. Php_curl.dll the three files under the PHP installation folder (possibly in the Ext folder), Libeay32.dll,ssleay32.dll copy to%windir%/system32;
2. Open PHP.ini (may be in the installation directory of the PHP environment, by default in the C:\WINDOWS directory), the Extension=php_curl.dll head of the semicolon removed;
3. Restart the PHP service (Apache or IIS), such as restarting IIS and running IISRESET.

Ii. How PHP Installs Curl extensions in Linux

If PHP has been compiled in the system, and then need to add a new extension, one way is to re-compile PHP completely, the other way is to compile the extension library separately, in the form of extension extension.

Situation one: New installation of PHP and curl

First Download the Curl installation package (my php is 4.4.4, download the latest Curl 7.16 can not be used, the last download 7.14 only, download to pay attention to the version)

Then install Curl

# TAR-ZXF (fill in the Download Curl package name here) #./configure–prefix=/usr/local/curl# make; Make install

When you install PHP, just turn on the switch –with-curl=/usr/local/curl.

PHP requires the directory of Curl to have the include and Lib directories, and include under the Easy.h and curl.h two files, Lib to have libcurl.a. The files under the compiled include are available, but they may not be available in the Lib directory. Originally generated to the Lib/.libs directory, so copy to the Lib directory.

Scenario Two: PHP is already installed, and now you need to add this extension

To install the original PHP source directory, (if deleted, but also the original compressed files, re-unzip the line)

CD ext/curlphpize  ./configure–with-curl=dir   (Can not write dir, if your curl is not specified when installing the directory) make

The curl.so file is generated under phpdir/ext/curl/moudles/.
Copy the curl.so file to the extensions configuration directory and modify the php.ini.

The above two are the Linux PHP Extension Curl installation method.

Install and turn on Curl Extensions for PHP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.