問題描述
我最近在我的開發服務器上切換到 PHP 7,它一直運行良好 - 直到現在.
I recently switched to PHP 7 on my development server, which has worked just fine - until now.
自從我更新到 PHP 7.0.3-10+deb.sury.org~trusty+1
(今天早些時候)后,utf8_decode
和 utf8_encode
函數不再可用.然而,它們在早期版本的 PHP7 中.調用時,會引發致命錯誤.
Since I updated to PHP 7.0.3-10+deb.sury.org~trusty+1
(earlier today), the utf8_decode
and utf8_encode
functions are no longer accessible. They were, however, in previous versions of PHP7. When called, a fatal error is raised.
我讀到這些函數是由 mbstring
擴展提供的,我用 var_dump(extension_loaded('mbstring'));
檢查了該擴展.
I read that these functions are provided by the mbstring
extension, which I checked with var_dump(extension_loaded('mbstring'));
is loaded.
我怎樣才能讓上述功能再次工作?
How can I get the above functions to work again?
推薦答案
我遇到了同樣的問題.只需安裝 php7.0-xml
包.Ubuntu 16.04:
I had the same problem. Just install php7.0-xml
package. Ubuntu 16.04:
sudo apt-get install php7.0-xml
重啟 apache2 以加載新包.
這篇關于從 php7 中刪除了 utf8_(en|de) 代碼?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!