I am using the sybase-ct drivers to connect to a sybase server.
My PHP is running on UNIX platform, but somehow it seems that the PHP is not recognizing either the Sybase Server Alias nor the IP address+port names. It just couldn't find the sybase server to connect.

I have already specified the interface file name the the ini file, but still to no avail. I understand that the sybase ct drivers don't need the interfaces file entry in the ini file to find it anyway, but I have no idea on why it couldn't find the sybase server.

Is there anything else that I need to set to get the PHP to recognize the sybase database server?

    Patrick,

    What ini file setting are you using to specify where the interfaces file is?

    What is the exact error that you are receiving?

    Sybase-CT does need the interfaces file to translate your logical name for the server to it's network address/port.

    You need to make sure that the SYBASE environment variable is set to the top of your Sybase installation.

    You can check if the variable is set for the server by creating a <?php phpinfo() ?> page and checking the HTTP_ENV_VARS at the bottom of the page.

    Frank

      Frank,

      I am using the sybase section of the php.ini file to specify the Sybase interfaces file = "/ms/dist/syb" (which is the place where sybase is installed in my environment.

      I am checked and the $SYBASE environment variable is already set to the same path i mentioned above, and I can see the sybase_Ct module active in the phpinfo() command.

      The problem is that php cannot connect to the sybase servers (couldn't find) but accepts all sybase commands correctly.

      I have 2 instances, one is apache web server and another is netscape web server. The apache one works fine, while the problem now is with the netscaper web server.

      Also Is there a version limitation? I mean what is the minimum sybase version that php can recognize?

        Patrick,

        I think the interfaces_file entry is for the --with-sybase not --with-sybase-ct, since it's in the [Sybase] seciton of the ini file, not the [Sybase-CT]. That being said, it should still find your interfaces file, since the SYBASE environment variable is set.

        The Open Client software would determine what versions of Sybase you could access, not PHP. Open Client seems to be very backwards compatable and able to access very old versions of Sybase. What version of Sybase are you running?

        What is the exact error message that you are receiving? I'm assuming that you are getting the message on a sybase_connect function?

        Frank

          The Exact Error message I am getting is
          "Cannot To Connect to Sybase Server". Using the interfaces file or not, the PHP is just not recognizing the database server, while it can correctly load the library drivers.

          I tried to compile with the freeTDS drivers, but PHP just woulnd't successfully compile correctly. I amd stuck.

            The Error Message I've go is the following:

            Warning: Sybase: Unable to connect in /var/ns-enterprise/var/doc/ms/group/it/hkeo/it/csd/test.php on line 13

            My line on 13 is
            $Linkidentifier= sybase_connect( $Servername,'user','password') ;

            Any Ideas?

              Patrick,

              Have you tried to connect with command line isql to the server (from that machine)? The syntax for isql is:

              isql -Uuser -Sserver -Ppassword

              If you connect, you'll get a prompt like 1> and you can just type exit. If you can connect with isql, then it's a php/sybase problem. If you can't connect from isql, then it's a plain Sybase problem.

              Frank

                Well I have tried that, was able to connect with no problem using isql but not with php/sybase. I have tried a normal / root user / webroot user but still not work. I suspect that its related to the php sybase combination running under nsapi mode.

                Any more ideas?

                  After carefull examination, it seems that I have mistaken.
                  The error returned by the sybase_connect command is infact, as follows:

                  Warning: Sybase: Unable to allocate connection record in /var/ns-enterprise/var/doc/ms/group/it/hkeo/it/csd/test.php on line 31

                  This is defintely a problem with the php not being able to allocated a sybase connection to the database.

                  Any ideas?

                  -- PAtrick

                    Write a Reply...