PDA

View Full Version : Recompiling cPanel/WHM's Internel PHP



BrandonTheG
November 21st, 2007, 15:19
Hello,

I was wondering if it was possible to recompile cPanel/WHM's internal PHP. I am looking to make some custom scripts for my WHM, and it needs a few more PHP extensions to do so. I am also looking to compile in mysqli support so I can switch to having phpMyAdmin to use mysqli.

I was looking at the cPanel/WHM's internal phpinfo.php page, it seems to be PHP 5.2.3. I tried phpize'in the extensions, but that didn't seem to work as they won't load.

Would basing a configure statement off this going to work?


./configure --enable-static --with-ldap=/usr/local/cpanel/3rdparty --with-iconv --enable-mbstring --with-mbstring=all --enable-mbstr-enc-trans --with-gd --with-dom --enable-mbregex --with-zlib --with-jpeg --with-png --with-imap=../../bsd/imap --enable-ftp --with-gettext --with-xml --enable-track-vars --enable-sockets --with-mysql=/usr --with-pgsql --with-config-file-path=/usr/local/cpanel/3rdparty/etc --prefix=/usr/local/cpanel/3rdparty

Thanks for looking at this too.

JonnyH
November 21st, 2007, 17:06
Log into WHM. Click update apache. Follow instructions.

BrandonTheG
November 21st, 2007, 17:26
That's the PHP used for websites, etc, not the one serving cPanel/WHM.

krakjoe
November 22nd, 2007, 18:34
If that's what php was configured with by whm, then yeah that'll work ...

When u phpize'd the extension sources did you just type phpize ??

There are more parameters you should pass such as --with-php-config=/path/to/cPanels/php-config and some extension specific parameters also ... use full paths to everything, there's no reason it shouldn't work if the build environment for cPanel's php is left intact ( which I suspect it is ) ...

BrandonTheG
November 22nd, 2007, 22:29
No, I used `/usr/local/cpanel/3rdparty/phpize`, but I will try the php-config thing too.