Compile PDO drivers from source

November 15, 2007

It was troublesome but at last I did it. I googled it and found someone has done this before on 6.06 the good howto is here. The author was able to pecl install pdo then downloaded from source and compiled in the server the pdo_mysql driver. I wasn’t that lucky I have to start from PDO extension first using the same method.

For PDO extension

tar zxvf PDO-1.0.3.tgz
cd PDO-1.0.3

Note that modding the configure file is not necessary for PDO extension then proceed

make install

Do the same, more or less for PDO_MYSQL

tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2
nano configure

Now carefully look for line 4163 which should read something like this
if test "x$is_it_shared" = "x" && test "x" != "xtrue"; then start commenting that line out until you see fi which is at line 4173. Check line number by doing ^C and go to the line you want by ^_[line number]

After that proceed

make install

Finally add below lines

to the bottom of files /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini. Don’t forget to start apache again by apache2ctl restart.

Watch careful for errors when it’s complied (make) and installed (make install) or else you’ll be like me doing this more than once.

Checking it again by phpinfo() to see your great achievement

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: