我最近在Windows 7 OS(32位)中安裝PHP 7。我使用的FTP庫nicolab/PHP的FTP客戶端的FTP功能和我得到一個例外,因爲PHP 7 FTP擴展未在Windows 7中加載
Fatal error: Uncaught FtpClient\FtpException: FTP extension is not loaded! in
而且我看到的代碼,有
if (!extension_loaded('ftp')) {
throw new FtpException('FTP extension is not loaded!');
}
所以我用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]
沒有ftp擴展名。但在PHP網站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.
我重新啓動Apache很多次。顯示的仍然是FTP異常錯誤。你能指導我解決這個問題嗎?
的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
謝謝,它的工作 –