How to make PHP support other database WITHOUT recompiling?

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

    #1

    How to make PHP support other database WITHOUT recompiling?

    By default PHP always supports MySQL.
    But all our database servers are PostgreSQL or
    Informix. Order for me get PHP supports other
    than MySQL. I need download PHP source codes and
    compiled it "--with-pgsql=/var/lib/pgsql" option.
    Then reinstall it.

    I think there is must a way I can edit the php.ini
    file, make php support other database beside MySQL.

    Would anyone out there tell me how to do that if you
    know the answer.

    Thank Q very much in advance!
  • Sjoerd

    #2
    Re: How to make PHP support other database WITHOUT recompiling?


    RC wrote:[color=blue]
    > I think there is must a way I can edit the php.ini
    > file, make php support other database beside MySQL.[/color]

    If you already have the modules, you can indeed do this. If you have
    installed PHP on Windows or used the package from your distribution, it
    is likely that you already have the modules or that they are available.
    If this is the case, you can enable them in php.ini.

    Comment

    • Mladen Gogala

      #3
      Re: How to make PHP support other database WITHOUT recompiling?

      On Mon, 17 Apr 2006 07:43:18 -0400, RC wrote:
      [color=blue]
      > I think there is must a way I can edit the php.ini
      > file, make php support other database beside MySQL.[/color]

      Indeed you can. You must download the corresponding PECL extension,
      compile it, put it in the right directory and enable it like this:

      extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922"
      extension=oci8. so

      For this, you must have shared library oci8.so in the directory defined as
      an extension_dir:
      [root@medo ~]# ls -l /usr/local/lib/php/extensions/no-debug-non-zts-20050922/
      total 272
      -rwxr-xr-x 1 root root 271587 Mar 31 08:43 oci8.so

      If you are running Windoze, ready-made extensions can be downloaded from
      http://pecl4win.php.net. If not, you'll have to download and compile your
      own. In theory, you should be able to write "pecl install <module>", but
      pecl command is a buggy junk that doesn't work, so you'll have to do it
      the hard way:

      pecl bundle <module>
      cd module
      phpize
      ../configure
      make
      make install



      --
      大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


      Comment

      Working...