[英]Can't get mbstring to work on Amazon linux 2 AMI
I run on Amazon linux 2 AMI, With PHP 7.2.5 and apache我在 Amazon linux 2 AMI 上运行,使用 PHP 7.2.5 和 apache
The probleme is: Call to undefined function mb_convert_encoding问题是:调用未定义的 function mb_convert_encoding
The initial need is to be able to read an uploaded text file correctly and have its content inserted in DB, knowing that the encodings can be various最初的需求是能够正确读取上传的文本文件并将其内容插入数据库,知道编码可以是多种多样的
The problem i am struggling with is to get mb_convert_encoding working !我正在努力解决的问题是让 mb_convert_encoding 工作!
i tried:我试过了:
sudo yum install php-mbstring
sudo yum install php7.2-mbstring
and all the possible variations and php versions, with a sudo service httpd restart between each attempt, nothing get the function to work.以及所有可能的变体和 php 版本,在每次尝试之间使用 sudo 服务 httpd 重新启动,function 无法正常工作。
Any suggestion?有什么建议吗? Thanks a lot非常感谢
I had the same issue, strangely when I reboot the instances it did enabled. 我遇到了同样的问题,奇怪的是,当我重新启动它确实启用的实例时。
First installed mbstring using this command: 首先使用以下命令安装mbstring:
sudo yum install php-mbstring
Then reboot 然后重启
sudo shutdown -r now
I don't know why restarting httpd not enough, but its work for me, hopefully will work for you. 我不知道为什么重启httpd不够,但是它对我来说很有用,希望对您有用。
I ran into the same issue where php exposed via apache httpd would not reflect the updated packages. 我遇到了同样的问题,其中通过apache httpd公开的php无法反映更新的软件包。 I could resolve the issue with 我可以解决这个问题
service php-fpm restart
and avoid the system restart 并避免系统重启
The correct package for PHP7.2 is: PHP7.2 的正确 package 是:
sudo yum install php72-mbstring
Then a simple HTTPD service restart applies the update:然后一个简单的 HTTPD 服务重启应用更新:
sudo service httpd restart
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.