PHP 7 FTP扩展未在Windows 7中加载 [英] PHP 7 FTP extension is not loaded in Windows 7

查看:1078
本文介绍了PHP 7 FTP扩展未在Windows 7中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在Windows 7 OS(32位)上安装PHP 7。我使用FTP库nicolab / php-ftp-client用于FTP功能,并且收到一个异常


$ b


致命错误:Uncaught FtpClient \FtpException :FTP扩展不是
加载!在

我看到代码,有

 <!c $ c> if(!extension_loaded('ftp')){
throw new FtpException('FTP extension is not loaded!');

$ / code>

所以我通过php检查了加载的扩展名

  C:\ Users \Tamil> php -m 
[PHP模块]
bcmath
日历
核心
ctype
卷曲
日期
dom
exif
过滤
gd
哈希
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
反射
会话
SimpleXML
肥皂
SPL
sqlite3
标准
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend模块]

没有ftp扩展名。但在PHP网站 http://php.net/manual/en/ftp.installation.php


Windows的PHP版本内置了对此扩展的支持。
您不需要加载任何额外的扩展以便使用
这些函数。

我重新启动Apache很多次。显示的仍然是FTP异常错误。你可以请指导我解决这个问题。



PHP版本是

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


解决方案

对我的系统进行快速测试显示了同样的问题:

  C: (c)1997-2015 PHP Group 
Zend Engine v3.0.0,Copyright(c)1998-2015 Zend Technologies
with Xdebug v2.4.0RC2,版权所有(c)2002-2015,由Derick Rethans

C:\ > php --ri ftp
扩展名'ftp'不存在。

查看 ext 文件夹显示 php_ftp.dll 。在 php.ini 中启用它,并重新运行上面的命令:

  C :\> php --ri ftp 

ftp

FTP支持=>启用
FTPS支持=>已启用

因此,启用扩展程序,您就可以正常使用。


I recently install PHP 7 in Windows 7 OS (32 bit). I used FTP library nicolab/php-ftp-client for FTP functions and I getting an exception as

Fatal error: Uncaught FtpClient\FtpException: FTP extension is not loaded! 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

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. But in PHP site http://php.net/manual/en/ftp.installation.php

The Windows version of PHP has built-in support for this extension. You do not need to load any additional extensions in order to use these functions.

I restart the apache many times. Still FTP exception error shown. Could you please guide me to solve this issues.

The PHP version is

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. Enabling this in php.ini and rerunning the above gives:

C:\>php --ri ftp

ftp

FTP support => enabled
FTPS support => enabled

So, enable the extension and you'll be fine.

这篇关于PHP 7 FTP扩展未在Windows 7中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆