Speed Up Databse Queries with the ADOdb Compiled PHP Extension

Permalink
This one is for all you speed demons out there. You know who are. I haven't benchmarked this a ton yet but the ADOdb page describes this a 100% speedup and it does feel a lot faster.

This quick guide will explain compiling, installing and configuring the ADOdb PHP extension written in C on a LAMP(Linux) based VPS or dedicated server environment.

There is also a quick guide for install on a Dreamhost shared account. This may be similar to your shared hosting provider but I would recommend referring to their documentation or sending them a quick note. I'm sure additions for other shared hosts would be greatly appreciated.

----------

On a VPS/Dedicated Server

1. Download and unzip the ADOdb extensionhttp://phplens.com/lens/dl/adodb-ext-504.zip...
1a. If using PHP5.3 download this patched adodb.chttp://raven.is-a-geek.net/post/PHP5.3/adodb.c... file and replace the one previously downloaded
2. Install php development tool
Debian/Ubuntu
apt-get install php5-dev

Redhat/CentOS
yum install php-devel

3. Open a terminal and navigate inside the unzipped adodb extension directory
4. Run
phpize
./configure
make
make install

5. Edit php.ini with
extension = adodb.so


[1]:http://phplens.com/lens/dl/adodb-ext-504.zip...
[2]:http://raven.is-a-geek.net/post/PHP5.3/adodb.c...


----------


On Dreamhost

1. Download and unzip the ADOdb extensionhttp://phplens.com/lens/dl/adodb-ext-504.zip...
1a. If using PHP5.3 download this patched adodb.chttp://raven.is-a-geek.net/post/PHP5.3/adodb.c... file and replace the one previously downloaded
2. Copy the files to your shared host via FTP.
3. If not already enabled, you need to enable ssh access through the Dreamhost panel.http://wiki.dreamhost.com/SSH
4. This guide only describes php5.3 configuration as it is much simpler so you will need to upgrade you domain to use PHP 5.3 FastCGI. (Under "Manage Domains")
5. Log into your account via ssh
6. Add
export PATH=/usr/local/php53/bin:$PATH
to
~/.bash_profile

7. Change to the directory you uploaded with the ADOdb files
8. Enter the commands
phpize
./configure
make
mkdir ~./php
mkdir ~./php/5.3
copy ./modules/adodb.so ~/.php/5.3/

9. On this next command replace [username] with you Dreamhost username.
echo "extension = /home/[username]/.php/5.3/uploadprogress.so" > ~./php/5.3/phprc

10. To check if it loaded properly you can create a phpinfo file.
10a. Created a php file in the domain root named
dontnamefilesphpinfo.php

and place in it
<?php phpinfo() ?>

11. You should see under "Configuration" "ADOdb" note that this could take a couple of minutes for Dreamhost to update so be a little patient.

mkly
View Replies:
mkly replied on at Permalink Reply
mkly
I really wish you could edit new topics.

*In the above Dreamhost description you will need to log out of the ssh session and back in after modifying the ~/.bash_profile. Sorry about that.

*On step 9. of the Dreamhost description it should read
echo "extension = /home/[username]/.php/5.3/adodb.so" > ~./php/5.3/phprc

Not
echo "extension = /home/[username]/.php/5.3/uploadprogress.so" > ~./php/5.3/phprc