Resource curl_init ([string $ url = null])
Modify configuration:
1. Modify the php Tutorial. ini and remove the semicolon before extension = php_curl.dll.
2. Copy the libeay32.dll and ssleay32.dll (c: apps tutorial ervphp5) files to the system32 directory.
3. Restart apache (services. msc).
<? Php
Echo "curl-function test <br> ";
If ($ load = 1 ){
Function webcheck ($ url ){
$ Ch = curl_init ($ url );
Curl_setopt ($ ch, curlopt_returntransfer, 1 );
$ Res = curl_exec ($ ch );
Curl_close ($ ch );
Return ($ res );
}
Echo "url = $ url <br> ";
$ Erg = webcheck ("my_page.php/test_1.php ");
$ Zahl = strlen ($ erg );
Echo "length = $ zahl ";
?>
If you encounter fatal error: call to undefined function curl_init () during usage, try the following operations:
Check whether curl extension support is available in php phpinfo!
Copy php_curl.dll to c: windows and c: windowssystem32 and restart apache.
Try again later
This file is not php_curl.dll.
Copy libeay32.dll and ssleay32.dll in the php directory to c: windowssystem32 and restart apache.
For more details, see: http://www.111cn.net/phper/31/83bccb7f05107b9ba65c22ce4dae1bf8.htm