How to enable CURL support in php

Release: 2023-02-28 18:42:02
forward
6910 people have browsed it

How to enable CURL support in php

When developing CMS with PHP, you need to use PHP's curl function. By default, this function needs to enable the CURL extension. If you have the right to use the host, you can use PHP.ini File to open this extension, the method is as follows:

1. Open php.ini, locate;extension=php_curl.dll, and remove the ";" in front of it.

2. Copy the three files: php_curl.dll, libeay32.dll and ssleay32.dll in the ext directory under the PHP directory to the system system32 directory, and restart IIS or apache.

3. In order to ensure whether the CURL extension is enabled, you can test it with the following code:

<?php
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,"www.baidu.com");
curl_setopt($ch,CURLOPT_HEADER,1);
curl_exec($ch);
curl_close($ch);
?>
Copy after login

Related recommendations:

PHP video tutorial: https://www.php.cn/course/list/29/type/2.html

The above is the detailed content of How to enable CURL support in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:cnblogs.com
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template