简体   繁体   中英

How do I enable mbstring on our PHP 5.4.33 Apache Server?

I recently moved to an unmanaged VPS and added a Joomla component to a client website and received the following error when attempting to use a specific part of the component.

Fatal error: Call to undefined function mb_strtolower() in /home/oursite/public_html/components/com_rsfiles/helpers/files.php on line 135

I'm sure if this was on a shared machine the error would not have been thrown because they would have configured the server to accept it. But that is not my case. I have to configure it to work.

The original error lead me to identify if mbstring was enabled on our server and it was not. 在此处输入图片说明

So I wondered how I could enable it. Googled it! found it may be a derivative of the php.ini file so I tried to enable it using this php.ini definition. zend.multibyte = 1. After adding the line I restarted the Apache web server but the php info page still showed it disabled. :-(

After making the above modification I received a different error when attemoting to access the same page throwing the original error. This is the new error:

Fatal error: Could not convert the script from the detected encoding "UTF-8" to a compatible encoding in /home/psgadmincore/public_html/libraries/legacy/controller/legacy.php on line 609

There are 8 other mbstring items in the php.ini file but they are all commented out.

;mbstring.language = Japanese
;mbstring.internal_encoding = EUC-JP
;mbstring.http_input = auto
;mbstring.http.output = SJIS
;mbstring.encoding_translation = On
;mbstring.detect_order = auto
;mbstring.substitute_character = none

;mbstring.func_overload = 0

I un-commented all of these thinking they had to be enabled also, but the "Could not convert the script" error is returned.

Can someone please direct me to a procedure that outlines the steps necessary to include the "Multibyte String library"?

CENTOS 6.7 x86_64 virtuozzo w/Cpanel - php 5.4.33

These sites have not help me: http://php.net/manual/en/ref.mbstring.php http://php.net/manual/en/ini.core.php#ini.zend.multibyte

Thank you

After @ceejayoz response I though I would upgrade the php build to 5.6. I used EasyApache in the WHM to carry out the process below. During the upgrade I was able to select mbstring module in the Exhaustive Options List.

  1. Log in to WHM as the 'root' user. In the Find box type easy. Click
  2. EasyApache (Apache Update). Leave default, and then click the gear icon (Customize Profile).
  3. Leave default, and then click Next Step.
  4. Click Exhaustive Options List. (this is where I selected the mbstring module)
  5. Click the name of the Apache or PHP module, and then click Save and build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM