Developing ON cPanel server with Zend Framework

jap

Registered
Apr 8, 2007
2
0
151
Hi,

I've just started using Zend Framework but it seems that cPanel isn't really "ready" for that, there were some things I would like to compile extra in my PHP version.

- PDO Mysql support
- Mod rewrite

I also can't install them using the software management system in WHM.
Would it be possible to compile the PHP again using shell and maybe using some plugins by cPanel if those exist?

Thanks
Jasper
 

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,483
35
208
cPanel Access Level
DataCenter Provider
Hi,

I've just started using Zend Framework but it seems that cPanel isn't really "ready" for that, there were some things I would like to compile extra in my PHP version.

- PDO Mysql support
- Mod rewrite

I also can't install them using the software management system in WHM.
Would it be possible to compile the PHP again using shell and maybe using some plugins by cPanel if those exist?

Thanks
Jasper
You can build them with easyapache.
 

empiror

Registered
May 17, 2007
4
1
151
PDO MySQL

This stumped me for a while as I needed PDO MYSQL for the excellent Zend Framework. You won't find PDO MySQL in easyapache as CPanel don't officially support it yet. I was, however, able to install it by compiling PHP manually. To do this you'll need to first install the latest PDO and PDO_MYSQL drivers which you can do with the following commands:

Code:
pecl install pdo

pecl install pdo_mysql
You then need to compile PHP manually with something similar to the following command lines:

Code:
service httpd stop

cd /home/cpapachebuild/buildapache

cd php-5.2.1 (or whatever is your latest install)

make clean

./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-magic-quotes --with-mysqli --with-mysql=/usr --with-openssl --enable-discard-path --with-pspell --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --enable-soap --with-zlib --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared

make

make install

service httpd restart
Make sure you get a copy of your existing configure line before issuing these commands and then add "--with-zlib --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared" to the end of it.

You'll then need to update the php.ini file with:

Code:
extension=pdo.so
extension=pdo_mysql.so
[You can find the location of your php.ini file and your existing compile options by running a PHP script that simply calls the phpinfo() function.]

Don't forget to restart apache again after updating the php.ini file with:

Code:
service httpd restart
Hope that helps.