Installing PHP extension mbstring in PHP 5.6 CentOS 6.8

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I am using PHP 5.6 on my centos-release-6-8.el6.centos.12.3.x86_64 server.

I got following error from one of my PHP function.

Fatal error: Call to undefined function mb_detect_encoding() 

So, I tried to install mbstring extension. when I execute

sudo yum install php-mbstring

CLI returns

Package php-mbstring-5.6.25-1.el6.remi.x86_64 already installed and latest version
Nothing to do

And I aslo tried "sudo yum install php56-mbstring" This returns

No package php56-mbstring available. Nothing to do

But still, PHP function giving me that error and there is no 'mbsting' in m.tuteehub.com/tag/phpinfo">phpinfo()

I also add the following m.tuteehub.com/tag/line">line to httpd.conf

LoadModule php5_module modules/libphp5.so

Server Restarted

Update:

[~]# php -v
PHP 5.6.22 (cli) (built: Jun 13 2016 11:43:51) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
[~]# php -m | grep mbstring
[~]# php -i | grep mbstring

Nothing returns to php -m | grep mbstring & php -i | grep mbstring

[~]# rpm -qil php-mbstring
Name        : php-mbstring                 Relocations: (not relocatable)
Version     : 5.6.25                            Vendor: Remi Collet
Release     : 1.el6.remi                    Build Date: Wed 31 Aug 2016 18:33:05 BST
Install Date: Mon 05 Sep 2016 16:26:05 BST      Build Host: builder.remirepo.net
Group       : Development/Languages         Source RPM: php-5.6.25-1.el6.remi.src.rpm
Size        : 2856446                          License: PHP and LGPLv2 and BSD and OpenLDAP
Packager    : http://blog.remirepo.net/
URL         : http://www.php.net/
/etc/php-zts.d/20-mbstring.ini
/etc/php.d/20-mbstring.ini
/usr/lib64/php-zts/modules/mbstring.so
/usr/lib64/php/modules/mbstring.so
/usr/share/doc/php-mbstring-5.6.25
/usr/share/doc/php-mbstring-5.6.25/libmbfl_LICENSE
/usr/share/doc/php-mbstring-5.6.25/oniguruma_COPYING
/usr/share/doc/php-mbstring-5.6.25/ucgendat_LICENSE

[~]# rpm -qa 'php*'
php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64
php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64
php-mbstring-5.6.25-1.el6.remi.x86_64
php-common-5.6.25-1.el6.remi.x86_64
profilepic.png
manpreet 2 years ago

Installing PHP extensions/modules via RPM will install the library files into /usr/lib64/php/modules/. Running php -i |grep ^extension_dir shows the extension directory that is currently configured.

An extension directory of /usr/local/lib/php/extensions/no-debug-non-zts-20131226 indicates that at some stage in the past, PHP was installed from source and that a php.ini file relating to this source installation is currently being used instead of the /etc/php.ini provided by the php-commonpackage.

To solve this problem, you should remove the remnants of this source installation. Unfortunately, the Makefile provided with PHP source code doesn’t include an uninstall target so you can’t simply run make uninstall. I’d suggest using the find command to track down these files by their modification date.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.