RSS
 

dbtcp on SuSe 10.x

07 Nov

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)

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

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

>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…


print("Hello World\n
");

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

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

if(dbtcp_sql("SELECT * FROM sometable"))
{
while($row = dbtcp_fetch_assoc())
var_dump($row);
}

var_dump($handle);
?>

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

 
2 Comments

Posted in PHP, Suse, dbtcp

 

Leave a Reply

 

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

 
  1. John

    May 7, 2008 at 7:08 am

    I was very happy to carry out the dbtcp configuration as you mentioned above but I wasn’t successful.
    my php -v command gives me
    “PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) ‘dbtcp.so’ in Uknow on line 0.”

    Any clue about this ?

    Regards
    John

     
  2. mike

    May 27, 2009 at 6:38 am

    I have to wonder how that comparison would fare if it was Vista vs Linux? We bought a new HP Vista machine and converted an old WIn 2K based desktop to SUSE Linux – http://file.sh/SUSE+Linux+torrent.html . After 2 months the hassles with Linux are far fewer! There are hassles with both, but the Linux hassles are well documented and Novell ($60 SUSE Linux support) actually DOES provide solutions in real English! We are preparing to convert the new machine to Linux as well.