Home > php教程 > php手册 > 在PHP中开启CURL扩展,使其支持curl()函数

在PHP中开启CURL扩展,使其支持curl()函数

WBOY
Release: 2016-06-13 09:37:45
Original
1453 people have browsed it

   在用PHP开发CMS的时候,要用到PHP的curl函数,默认状态下,这个函数需要开启CURL扩展,有主机使用权的,可通过PHP.ini文件开启本扩展,方法如下:

  1、打开php.ini,定位到;extension=php_curl.dll,将其前面的;去掉。

  2、将PHP目录下ext目录中的:php_curl.dll、libeay32.dll和ssleay32.dll三个文件复制到系统system32目录下,重启IIS或apache。

  3、为了确保是否已开启CURL扩展,可通过下述代码进行测试:

  view sourceprint?1

  2$ch = curl_init();

  3curl_setopt($ch,CURLOPT_URL,"www.baidu.com");

  4curl_setopt($ch,CURLOPT_HEADER,1);

  5curl_exec($ch);

  6curl_close($ch);

  7?>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template