After installing php, an error occurred in the mb_strpos function, so I will write it as a memorandum.
CentOS Linux release 8.2.2004 (Core) PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
After using the mb_strpos function in the console, an error occurs if it is not defined
php > echo mb_strpos("ontama", "a");
php > mb_strpos PHP Warning: Uncaught Error: Call to undefined function mb_strpos() in php shell code:1 Stack trace:
In the case of Centos, it seems that mb_strpos is not available by default, so it seems that you need to install the package Install php-mbstring required when using multibyte string related functions
[root@localhost etc]# yum install -y php-mbstring
Reboot the OS
[root@localhost etc]# reboot
Start the console and check if the mb_strpos function can be used
[root@localhost etc]# php -a
php > echo mb_strpos("ontama", "a");
3
Confirm that it can be used safely.
The one that I forgot to put in when building the php environment and moss ... https://qiita.com/sango/items/a86f9b8cf8c9c641823a
Recommended Posts