简体   繁体   English

无法让 mbstring 在 Amazon linux 2 AMI 上工作

[英]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.

相关问题 增加 Amazon Linux 2 AMI /tmp 大小 - Increasing Amazon Linux 2 AMI /tmp size 无法在亚马逊 linux 实例上安装 docker - Can't install docker on amazon linux instance ECS 代理是否需要 Amazon Linux AMI 才能运行? - Does ECS Agent require an Amazon Linux AMI in order to run? 用于 rhel-fedora Amazon Linux AMI 的 ClamAV 版本更新 - ClamAV Version Update for rhel-fedora Amazon Linux AMI 无法使 airflow AWS 连接工作“ModuleNotFoundError:没有名为‘airflow.providers.amazon’的模块” - Can't get airflow AWS connection to work "ModuleNotFoundError: No module named 'airflow.providers.amazon" Amazon 自定义 AMI 未加入 EKS 集群 - Amazon custom AMI doesn't join to EKS cluster CPAN 在 EC2/Linux AMI 上安装失败:“无法解压缩” - CPAN installs fail on EC2 / Linux AMI: "Couldn't untar" 无法让 Boost C++ 库在 AWS Linux 环境中工作 - Can't get Boost C++ Libraries to work in an AWS Linux Environment 无法在 Amazon EC2 上使用 JDK 11 安装 Jenkins Linux 2 AMI with Packer - Failed to install Jenkins with JDK 11 on Amazon EC2 Linux 2 AMI with Packer KVM 支持带有 Amazon AMI 的 Android 模拟器 - KVM Support for Android Emulator with Amazon AMI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM