search
Homephp教程php手册win7(X64)系统环境PHP Curl函数不能使用

Curl函数在php中一个默认未开启的组件,如果你需要使用Curl我们需要在php.ini中把extension=php_curl.dll前面的;去掉即可.

我先是把php.ini中的extension=php_curl.dll前面的;去掉了,并且重启了apache环境,但调用如下函数时提示,代码如下:

<?php 
	// 初始化一个cURL对象 
	$curl = curl_init();  
	// 设置您需要抓取的URL 
	curl_setopt($curl, CURLOPT_URL, &#39;http://www.phprm.com&#39;&#39;); 
	// 设置header 
	curl_setopt($curl, CURLOPT_HEADER, 1); 
	// 设置cURL参数,要求结果保存到字符串中还是输出到屏幕上 
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
	// 运行cURL,请求网页 
	$data = curl_exec($curl); 
	// 关闭URL请求 
	curl_close($curl); 
	// 显示获得的数据 
	var_dump($data); 
	 

错误提示:Call to undefined function curl_init()

看了相关文章我又把将PHP的ext目录下的三个文件:php_curl.dll、libeay32.dll和ssleay32.dll复制到系统system32目录中,但还是不行,于是再接google发现win7(x64)有一点区别了自带的php_curl.dll文件在64位windows7环境下并不能运作.

具体解决步骤:

1、单击通知栏wamp图标,在php-ext里找到php_curl选项,单击选中,等待wamp重启服务完成。

2、下载修复过的php_curl.dll(php5.X/X64位系统)文件,放置到wampbinphpphp(版本号)ext文件夹下。

3、重新启动wamp服务即可。

提示:找了这么久原来是我们安装的php环境与系统版本不同,我们最好是多少位系统选择多少位的php版本哦.

文章地址:

转载随意^^请带上本文地址!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software