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
Opened MakeFile and added -fPIC to CCFLAGS (line 11)
Opended dbug/dbug.c and commented out IMPORT int fprintf(); (line 210)
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!
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 = "10.10.10.10";
$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 🙂