简体   繁体   English

Windows 7中未加载PHP 7 FTP扩展

[英]PHP 7 FTP extension is not loaded in Windows 7

I recently install PHP 7 in Windows 7 OS (32 bit). 我最近在Windows 7操作系统(32位)中安装了PHP 7。 I used FTP library nicolab/php-ftp-client for FTP functions and I getting an exception as 我使用FTP库nicolab / php-ftp-client进行FTP功能,我得到一个例外

Fatal error: Uncaught FtpClient\\FtpException: FTP extension is not loaded! 致命错误:未捕获FtpClient \\ FtpException:未加载FTP扩展! in

And I see the code, there is 我看到了代码,有

if (!extension_loaded('ftp')) {
    throw new FtpException('FTP extension is not loaded!');
}

So I checked the loaded extension by php 所以我通过php检查了加载的扩展名

C:\Users\Tamil>php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
filter
gd
hash
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
SimpleXML
soap
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

There is no ftp extension. 没有ftp扩展名。 But in PHP site http://php.net/manual/en/ftp.installation.php 但是在PHP网站http://php.net/manual/en/ftp.installation.php中

The Windows version of PHP has built-in support for this extension. Windows版本的PHP内置支持此扩展。 You do not need to load any additional extensions in order to use these functions. 您无需加载任何其他扩展即可使用这些功能。

I restart the apache many times. 我多次重启apache。 Still FTP exception error shown. 仍显示FTP异常错误。 Could you please guide me to solve this issues. 你能指导我解决这个问题吗?

The PHP version is PHP版本是

C:\Users\Tamil>php -v
PHP 7.0.0 (cli) (built: Dec  3 2015 11:36:59) (ZTS ) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

A quick test on my system shows the same problem: 对我的系统进行快速测试显示了同样的问题:

C:\>php -v
PHP 7.0.0 (cli) (built: Dec  3 2015 11:36:58) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC2, Copyright (c) 2002-2015, by Derick Rethans

C:\>php --ri ftp
Extension 'ftp' not present.

Looking in the ext folder shows a php_ftp.dll . 查看ext文件夹显示一个php_ftp.dll Enabling this in php.ini and rerunning the above gives: php.ini启用它并重新运行上面的内容给出:

C:\>php --ri ftp

ftp

FTP support => enabled
FTPS support => enabled

So, enable the extension and you'll be fine. 所以,启用扩展程序,你会没事的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM