我尝试了所有我能找到的指令How to get CURL to work with PHP on Windows? (WAMP)
将dll文件从php7.2.0
文件夹复制到apache2.4.18\
bin文件夹
我的设置
win 10 64
wamp 3.1.1
php, 5.6.28, 7.0.4, 7.2
apache 2.4.18
curl适用于任何其他php版本,但不适用于7.2
脸颊extension_dir
路径,它指向正确的目录
extension_dir ="T:/wamp64/bin/php/php7.2.0/ext/"
加载php 7.2扩展
extension=bz2
extension=curl
;extension=dba
extension=com_dotnet
;extension=enchant
extension=fileinfo
;extension=ftp
extension=gd2
extension=gettext
extension=gmp
extension=intl
extension=imap
;extension=interbase
extension=ldap
extension=mbstring
extension=exif ; Must be after mbstring as it depends on it
extension=mysqli
;extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=phpdbg_webhelper
;extension=shmop
现在我在7.0.4中看到有php_前缀和dll后缀
extension=php_curl.dll
但这是在7.2信息中
; When the extension library to load is not located in the default extension
; directory, You may specify an absolute path to the library file:
;
; extension=/path/to/extension/mysqli.so
;
; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and
; 'extension='php_<ext>.dll') is supported for legacy reasons and may be
; deprecated in a future PHP major version. So, when it is possible, please
; move to the new ('extension=<ext>) syntax.
;
; Notes for Windows environments :
;
; - ODBC support is built in, so no dll is needed for it.
; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.
别人有同样的问题,但没有解决方案http://forum.wampserver.com/read.php?2,149346,149609#REPLY
解决方案对我有用
安装Apache 2.4.29,
由于某种原因2.4.18没有加载PHP 7.2卷曲
希望这会对某人有所帮助。我花了4个小时找到解决这个问题的方法,但我找不到任何有效的方法。所以我做的是(Windows 10 x64 + Apache 2.4.29):
;extension=curl
更改为extension=php_curl.dll
它有效!!!
当然将指向旧的php版本文件夹的Windows PATH变量更改为新文件夹。我读了一些评论,认为复制和粘贴文件并不是一个好主意,但这是唯一对我有用的选项。
视窗
在PHP 7.2之前,curl和openssl需要你的根PHP文件夹中的以下文件(其中NN
是32
或64
,具体取决于你的安装):
7.2中缺少这些文件。现在,PHP 7.2(7.2包的一部分)需要以下文件:
我想在php 7.2和apache 2.4.39中使用cURL,所以这里的步骤适用于Windows 10上的WAMPSERVER 64 BITS(X64)3.17: