Write following code and run
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
If php_curl.dll does not work then error show
“Fatal error: Call to undefined function curl_init() in ……………..”
You can also run following code in php script
If cURL enable on your server then you can see curl enable in phpinfo page.
If you install PHP, Apache in Windows operating system then following step can
help you to run php_curl.dll smoothly.
- find the location of php.ini (probably in c:/windows) file and open it. then
uncomment (remove semi-colon(;) from ;extension=php_curl.dll ) the line. and
save the file
- copy php4ts.dll (if you use PHP4) or php5ts.dll (if you use PHP5),
libeay32.dll and ssleay32.dll to the C:/WINNT (Windows 2000) or C:/Windows
(WindowsXP and 2003) directory. (if php4ts.dll or php5ts.dll not found in your
computer thn search in google and download. other two dll can found in the dlls
directory of your PHP directory(may be in c:/php/ext))
- restart Apache service.
check again that cURL is enable. if not then restart your computer.
Now run script again and see your php_curl is now working smoothly.
If not then,
copy above 3 dll file (describe in 2) to your php root directory (may be c:/php)
and also in windows system32 directory (c:/windows/system32)
Have a nice day…….