I am trying to install a CMS which requires the mbstring module for PHP. According to that page, the module is installed but not activated by default. The article links to an install page which "explains" how to configure PHP. Unfortunately the install "manual" of PHP expects that you install Apache and PHP via source packages and compile them. So the other 95% of webserver admins do not get any help by this. I could not find anything senseful on how to enable modules without recompiling one's own PHP. Since I am using a very specific distribution with its own packages etc. I just can not compile anything myself.

So is there a way to enable modules (in this case mbstring) without that hassle?

Thanks in advance!

  • Can you tell us a little bit about your environment? OS, package manager etc? – sysadmiral Dec 2 '15 at 12:35
  • I use Univention Corporate Server 4.1 (based on Debian wheezy) and apt – valh Dec 2 '15 at 12:41

Have you tried the following?

apt-get install php-mbstring

It is no big deal to recompile PHP really, just download the source from PHP homepage, extract, run configure, run make, run make install:

apt-get update && apt-get install -y \
    autoconf \
    file \
    g++ \
    gcc \
    libc-dev \
    make \
    pkg-config \
    re2c \
    ca-certificates \
    curl \
    libedit2 \
    libsqlite3-0 \
    libxml2 \
    xz-utils \

wget https://secure.php.net/get/php-5.6.30.tar.bz2/from/this/mirror
tar -jxvf php-5.6.30.tar.bz2
cd php-5.6.30
./configure \
    --disable-cgi \
    --enable-ftp \
    --enable-mbstring \
    --enable-mysqlnd \
    --with-curl \
    --with-libedit \
    --with-openssl \
    --with-zlib \
    #--with-config-file-path="$PHP_INI_DIR" \

make -j "$(nproc)"
make install

You will need to do one more thing to get apache2 to use the php in /usr/local instead, such as:

find /usr/local|grep libphp # get path of new PHP lib
grep libphp /etc/apache2/* -R # find file to update
# edit the file and change to use newly compiled PHP        

service apache2 restart

An alternative is to use Docker, but will need even more elaborate changes than just updating PHP - although, well worth looking into: https://docs.docker.com/engine/installation/linux/debian/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.