PHP code sending blank username and password

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
spai01
Forum Newbie
Posts: 1
Joined: Tue Oct 28, 2008 12:56 am

PHP code sending blank username and password

Post by spai01 »

Using PHP - 5.2.6
Apache/2.2.8
Sybase CT 12.5.1

Compiled PHP as below;
SYBASE=/apps/gentools/openclient
SYBASE_OCS=OCS-12_5
CFLAGS='-I/apps/gentools/openclient/OCS-12_5/include'
LDFLAGS='-R/apps/gentools/openclient/OCS-12_5/lib -L/apps/gentools/openclient/OCS-12_5/lib'
LD_LIBRARY_PATH=/package/openldap/lib:/package/httpd-2.2.8/lib:$SYBASE/$SYBASE_OCS/lib
LIB=$SYBASE/$SYBASE_OCS/lib
PATH=/package/httpd-2.2.8/bin:package/openldap/bin:$SYBASE/$SYBASE_OCS/bin:/apps/gentools/gnu/bin:/apps/gentools/local/bin:/usr/local/bin:/apps/datatools/sbacktrack/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/etc:/usr/etc

export SYBASE SYBASE_OCS CFFLAGS LDFLAGS LD_LIBRARY_PATH PATH LIB


./configure --with-apxs2=/apps/sybase/apache_web/bin/apxs \
--prefix=/apps/sybase/apache_web \
--with-sybase-ct=$SYBASE/$SYBASE_OCS \
--with-libxml-dir=/package/libxml2-2.6.29 \
--with-ldap=/package/openldap \
--with-config-file-path=/apps/sybase/apache_web/conf \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-gd=shared

PHP pages are rendered correctly by appache. Just the Sybase connection fails as PHP is sending blank user and password to the database
<?php
$con = sybase_connect("SYD_DEV", "testphp", "testphp");
sybase_select_db("my_db");
$qry = sybase_query("select * from sysobjects", $con);

echo sybase_result($qry, 1, 1);

sybase_close($con);
?>

This fails with
Warning: sybase_connect() [function.sybase-connect]: Sybase: Server message: Login failed. (severity 14, procedure N/A) in /apps/sybase/apache_web/test.php on line 2
Warning: sybase_connect() [function.sybase-connect]: Sybase: Client message: Login incorrect. (severity 78) in /apps/sybase/apache_web/test.php on line 2
Warning: sybase_connect() [function.sybase-connect]: Sybase: Unable to connect in /apps/sybase/apache_web/test.php on line 2

If I trace the connection on the database, the errorlog shows

00:00000:00090:2008/10/28 16:43:19.90 Logon Login failed. User: , Client IP address: '65.111.25.30'.

The PHP is sending the login request to the correct database ' SYD_DEV', but the user and password are coming in as blank resulting in the Login Failed error on the database.

I've attached my httpd.conf and php.ini. What could be wrong?

I have tried single/double quotes in php, used the $con = sybase_connect($server='SYD_DEV',$user='testphp',$pass='testphp');
still no luck.

Please assist
Post Reply