The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to add mbstrings using cPanel?

Discussion in 'General Discussion' started by yashax, Dec 4, 2007.

  1. yashax

    yashax Registered

    Joined:
    Mar 3, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Our existing environment:
    WHM 11.11.0 cPanel 11.15.0-R18264
    CENTOS 4.5 i686 on virtuozzo - WHM X v3.1.0

    We have installed PHP app on our server and when attempting to run it received the following error: Fatal error: Call to undefined function: mb_ereg_replace() in /home/spf/public_html/dolphin/inc/utils.inc.php on line 120

    After researching this error it seems that we must recompile PHP to add mbstrings extension.

    Can someone please provide detailed instructions on how to do this?

    Please help.

    Thank you,
    Jake
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Sure,

    The easiest way for you would be to simply compile apache.

    whm > software > apache update

    1. If you are not sure what to select, use " start customizing based on profile"
    2. chose the apache version, your current version should be pre-selected, hit next step.
    3. Your current php main version should be pre-selected, hit next step.
    4. Your current php minor version should be pre-selected, hit next step.
    5. Under basic options, click 'advanced configuration'
    6. From this list you can select your desired modules. Be sure that 'unique ID' is selected as well.

    jay
     
  3. yashax

    yashax Registered

    Joined:
    Mar 3, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thank you very much Jay.

    I did the following yesterday and all hell broke lose.

    I went to PHP admin and edited the advanced config and selected the mb_strings. Then I ran the Apache Update.

    Afterwards non of the PHP websites, like Joomla worked. They all said that they could not connect to database. I reran the Apache Update without mb_strings selected, but that did not make any difference.

    I was lucky that the backup was there, so I ran the restore command and restored the apache config from the backup. That partially fixed the problem. I also had to delete all .htaccess config files from each website root directory, which finally put everything back to normal.

    I don't know what happened or why I had to do what I did.

    I am paranoid now! :) Any insights as to why and what to do?

    Thank you,
    J
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    perhaps someone can offer some help. I would suggest reading through some EA3 threads as there may be too many variables to consider without seeing your logs.

    I didn't experience this even on many vps upgrades to apache 2.2.

    Good luck with it, your next option may be to compile php manually. Its not that difficult. Search around, you will find many tutorials on it. I still recommend using EA3 because sooner or later you will need to use it regardless.
     
  5. yashax

    yashax Registered

    Joined:
    Mar 3, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Totally ignorant. What is EA3 and where do I look? :(
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you are on one of the latest builds of EDGE, CURRENT or RELEASE, you can find EasyApache 3 in the WHM interface by going to the Software section then clicking on Apache Update.

    If you are on STABLE, note that EasyApache 3 has not yet propagated to STABLE. You would still be on EasyApache 1.
     
  7. yashax

    yashax Registered

    Joined:
    Mar 3, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Before I run the Apache Update and check MBSTRINGS option, what files can I backup manually to ensure that incase it does not work, I can easily recover?

    Also, for my understanding, if I check MBSTRINGS and run a compile process and all PHP sites do not work, after I restore the Apache config by using the command line restore utility, does that UNDO the MBSTRNGS compilation? Cna I restore the Apache config without undoing the MBSTRINGS?

    What do I need to do to ensure that MBSTRINGS still stays there?

    Please help.

    Thank you,
    Jake
     
  8. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    Updated cPanel last night, and recompiled PHP4/5 with mbstrings & mcrypt (in addition to my other options).

    Ran without a hitch. I suppose had I ran into errors, I would have gone through EA3 again without those two options ticked, my httpd.conf seems pretty awesome in it's ability lately to not break each time apache wants to rewrite it.
     
Loading...

Share This Page