dbtcp on SuSe 10.x

First off, to compile dbtcp as a PHP extension, you’ll need to have phpize installed. I didn’t, so I opened up YAST and click on PHP’s devel package. A YAST dependency warning is thrown, click remove php-devel, press OK, select ignore and OK.

Extract archive to /usr/src/dbtcp

>cd /usr/src/dbtcp

Opened MakeFile and added -fPIC to CCFLAGS (line 11)
Opended dbug/dbug.c and commented out IMPORT int fprintf(); (line 210)

>cd /usr/src/dbtcp/php/dbtcp
>./configure –with-dbtcp=/usr/src/dbtcp
>make install

Create a file, “/etc/php5/conf.d/dbtcp.ini” with contents of

>service apache2 restart

At this point dbtcp is installed and “good to go” on the SuSe box. Let’s try it out!

Run DBTCP.exe
I went ahead and clicked on the “Allowed IPs” icon (it’s the icon with the bust of a person) and typed in the IPAddress of the SuSe box.

Okay back to SuSe. We need a quick PHP script to test things out…


$dsn = "DSN=Projects";
$host = "";

$handle = dbtcp_connect($dsn,$host);

if(dbtcp_sql("SELECT * FROM sometable"))
while($row = dbtcp_fetch_assoc())


That’s it, you just saved yourself from buying a $1,500 driver 🙂