Install curl templates in php. Curl is a file transfer tool using URL syntax. it supports FTP, FTPS, HTTPHTPPSSCPSFTPTFTPTELNETDICTFILE, and LDAP. Curl supports SSL certificates, HTTPPOST, HTTPPUT, and FTP uploads. curb curl is a FILE transfer tool using URL syntax. it supports FTP, FTPS, http htpps scp sftp tftp telnet dict file and LDAP. Curl supports SSL certificates, http post, http put, and FTP uploads, kerberos, HTT-based Upload, proxy, cookie, user + password proof, file transfer recovery, http proxy channel and a large number of other useful techniques.
After php is installed, the curl function extension is not enabled by default. you can enable this function extension in the following steps.
Install curl in windows
1. open the PHP installation directory, search for the following three files: ssleay32.dll, libeay32.dll, and php_curl.dll, and copy them to the system32 folder in the system directory one by one,
2. modify the php. ini file, find the; extension = php_curl.dll line, remove the previous; number, save, and restart the server.
3. test. create a php file under the site directory. the content is as follows:
The code is as follows: |
|
$ Ch = curl_init ("http://www.bKjia. c0m "); Curl_exec ($ ch ); Curl_close ($ ch ); |
Install curl in linux
Assume that the originally compiled php directory is under the/usr/local/php5 directory;
Apache is in the/usr/local/apache2 directory;
The php source code is in the/home/kevin125/src directory.
If the actual directory is different from the assumed Directory, make adjustments in the following command.
1. find the source code directory of the currently running php version, such as the php-5.2.10.
Enter the curl Extension Library Directory.
The code is as follows: |
|
$ 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: |
|
$/Usr/local/php5/bin/phpize |
3. Compile the extension library and execute the following configure and make Commands respectively.
The code is as follows: |
|
$./Configure-with-php-config =/usr/local/php5/bin/php-config |
After configure passes this step, execute the make command. if configure fails, find the cause of the error.
$ Make
After make is successfully executed, the generated 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. configure the php. ini file
Copy the compiled extension library file to the apache2 modules Directory.
The code is as follows: |
|
$ 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 edit it. You can view the phpinfo information to determine the location of the php. ini file.
Find the location for setting the extension directory in the php. ini file, and then set the extension path to the apache2 modules Directory.
The code is as follows: |
|
Extension_dir = "/usr/local/apache2/modules /" |
Set the extension Library location in php. ini and the extension library to be added.
The code is as follows: |
|
Extension = curl. so |
Http://www.bkjia.com/PHPjc/632849.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/632849.htmlTechArticlecurl is a transfer FILE tool that uses URL syntax and supports FTP, FTPS, http htpps scp sftp tftp telnet dict file and LDAP. Curl supports SSL certificate, http post, http put, FTP upload, curb...