Need a database connector in PHP? Might not need to recompile.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Google Mike

    #1

    Need a database connector in PHP? Might not need to recompile.

    I just found out from someone named Frank M. Kromann in one of the
    other PHP forum websites that I don't have to recompile PHP on Linux
    in order to add a database connector. I've been pulling my hair out on
    this issue for several days now, so I wish to publicly thank Frank M.
    Kromann, whereever he is. He didn't leave a valid reply email to me,
    but he's alright in my book.

    Let's say you have a beautiful Linux and PHP install. Everything is
    working just right for you with PostgreSQL and MySQL, and now you have
    some request from management to connect something like MSSQL, but you
    find out that your install of Linux doesn't come with that connector.
    My install, RH9, didn't. I had already written several pages of code
    with my PHP, and I didn't want to risk it by reinstalling PHP and
    Apache.

    So, I got FreeTDS downloaded, installed properly, and connected via
    its tsql test tool (/usr/bin/tsql) to my MS SQL Servers. Now all I had
    to do was make Apache and PHP recognize it.

    Frank said that all I need to do is download the PHP source, then do:

    ../configure --with-mssql,shared
    make[color=blue][color=green][color=darkred]
    >>>DO NOT DO MAKE INSTALL<<<[/color][/color][/color]

    This creates an mssql.so file, he said. Then, he said to copy this to
    the PHP extension dir. To find out where that is, just look for
    mysql.so or pgsql.so on your hard drive if you already have PHP
    connecting to MySQL or PostgreSQL. Or, look for imap.so.

    Next, he said I have either the choice of editing my PHP.INI file, or
    use the dl() function at the top of a page in order to mount this .so
    file when I need it, making the mssql_* API available within PHP.

    And that's it. Now all I have to do is test his process out. I'm going
    to need to get the source for PHP version 4.2.2 (that's what I have
    and rely on right now with RH9)...stay tuned...
Working...