PHP Installation Curl Template Method _php Tutorial

Source: Internet
Author: User
Tags ldap php source code ssl certificate
Curl is a routing file tool that uses URL syntax to support FTP, FTPS, HTTP htpps SCP SFTP TFTP, TELNET DICT file, and LDAP. Curl supports SSL certificates, HTTP POST, http PUT, FTP uploads, Kerberos, HTT-based uploads, proxies, cookies, user + password proofs, file transfer recovery, HTTP proxy channels, and a number of other useful tricks.

After PHP is installed, the default is not to enable the Curl feature extension, the following steps can be turned on this feature extension.

Windows installation Curl


1, open the PHP installation directory, search the following three files Ssleay32.dll, Libeay32.dll and Php_curl.dll, one by one copy to the system directory under the System32 folder,

2, modify the php.ini file, find; extension= php_curl.dll Line, remove the previous; number, save, restart the server.
3, test, in the site directory to create a PHP file, the content is as follows

The code is as follows Copy Code

$ch = Curl_init ("http://www.bKjia.c0m");
Curl_exec ($ch);
Curl_close ($ch);

Linux Installation Curl

If the original compiled PHP directory in the/USR/LOCAL/PHP5 directory;
Apache under the/usr/local/apache2 directory;
The PHP source code is in the/HOME/KEVIN125/SRC directory.

If the actual directory is inconsistent with the assumed directory, make the adjustment in the following command.

1. Locate the source code directory for the currently running PHP version, such as php-5.2.10.

Enter the Curl Extension Library directory.

The code is as follows Copy Code
$CD/home/kevin125/src/php-5.2.10/ext/curl

2. Call the Phpize program to generate the compilation configuration file.

The code is as follows Copy Code
$/usr/local/php5/bin/phpize

3. Compile the extension library and perform the following configure and make commands, respectively.

The code is as follows Copy Code
$./configure–with-php-config=/usr/local/php5/bin/php-config

Configure this step is performed after the make command is executed, and if configure execution does not pass, the reason for the error is found.
$make

When make is executed successfully, the resulting extension library file is in the modules subdirectory of the current directory, such as/home/kevin125/src/php-5.2.10/ext/curl/modules/curl.so

4. Configuring the php.ini File
Copy the compiled extension library files to the Apache2 modules directory.

The code is as follows Copy Code
$CP/home/kevin125/src/php-5.2.10/ext/curl/modules/curl.so/usr/local/apache2/modules/

Locate the directory where the php.ini file is located, and then edit it. You can determine the php.ini file location by viewing the phpinfo information.
Locate the Settings extension directory in the php.ini file, and then set the extension path to the Apache2 modules directory

The code is as follows Copy Code
Extension_dir = "/usr/local/apache2/modules/"

In the php.ini Settings extension Library location, set the extension library to be added.

The code is as follows Copy Code
Extension=curl.so

http://www.bkjia.com/PHPjc/632849.html www.bkjia.com true http://www.bkjia.com/PHPjc/632849.html techarticle Curl is a routing file tool that uses URL syntax to support FTP, FTPS, HTTP htpps SCP SFTP TFTP, TELNET DICT file, and LDAP. Curl supports SSL certificate, HTTP POST, http PUT, FTP upload, kerb ...

  • 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.