Today, I needed to set-up an instance of module for a client that was running CentOS 6 on a VPS (virtual server) deployed with the DirectAdmin control panel running on top of it.

Ok, no big deal, I have set-up countless number of moodle installations, have performed upgrades between multiple different versions without any issues but the set-up I’ve dealt with today took kinda longer than usual because of the fact that DirectAdmin compiles almost everything from source and the box had software (PHP and MySQL particulary) that didn’t meet the requirements of the latest version of moodle 2.4 which requires PHP >= 5.3.2 and MySQL >= 5.1.33

Other than this, there were also multiple other things needed to be done in order to get the installation of moodle going. The SOAP, INTL and XMLRPC PHP extensions were missing and the database was not converted to UTF8

So, how did I proceed with it? Well, first of all I needed to upgrade the PHP version from 5.2 to 5.3. In DirectAdmin this is quite easy to achieve by taking advantage of their build system and re-compiling PHP using

cd /usr/local/directadmin/custombuild
./build set php5_ver 5.3
./build update
./build php n

ok, once the compilation of PHP completed I verified the PHP version by running php -v and proceeded with enabling the PHP-SOAP, PHP-INTL and PHP-XMLRPC in the DirectAdmin’s custombuild PHP configure script by first navigating over to the custombuild directory and then creating a custom configure script because otherwise the default one will be overwritten when running ./build update so

cd /usr/local/directadmin/custombuild
mkdir -p custom/ap2
cp -pf configure/ap2/configure.php5 custom/ap2/configure.php5

edit the file:

nano custom/ap2/configure.php5

and appended the following three lines (mbstring was already there)

--enable-mbstring \
--enable-soap \
--enable-intl \
--with-xmlrpc \

I have saved and close the file and start rebuilding PHP:

./build php n

I then faced an error like this

checking for location of ICU headers and libraries… not found
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

…cool, I have installed libicu-devel:

yum install libicu-devel

and tried to build PHP again using

./build php n

that recompiled the PHP with the required extensions and module also detected them as OK so the final thing I needed to complete was to upgrade the MySQL version to 5.1 by executing

cd /usr/local/directadmin/custombuild
./build set mysql 5.1
./build set mysql_inst yes
./build set mysql_backup yes
./build update
./build mysql

once the MySQL upgrade completed I needed to recompile PHP as recommended by DirectAdmin by simply doing

That’s it

Leave a Reply

Your email address will not be published. Required fields are marked *