PHP memory allocation problem with Freetds libs

We are trying to use Freetds to connect from Linux (Apache/2.2.11 - PHP/5.2.9 ) to MSSQL 2000...
We have the following error "Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1230848 bytes) in /usr/local/apache2/htdocs/test_connection.php on line 18

We increased the memory in php.ini with "memory_limit = " from 32MB to 512MB but we still have the same error.

If I change the code to run a simple query like select * from F_CATALOG where CL_No=12"
we dont have any error even with php.ini memory_limit = " set to 32MB

When we run complex Oracle queries we never faced such problems even "memory_limit = " set to 32MB

I m pasting the php script here.

Any helps ideas will be very helpful

  putenv("SYBASE = /usr/local/freetds");
  putenv("TDSVER = 8.0");
  putenv("FREETDSCONF = /usr/local/freetds/etc/freetds.conf");
/*  $link = sybase_connect('server', 'test', 'test') or die("Could not connect !");
	echo "Connected successfully";
$dbproc = sybase_connect("server","test","test");
if (! $dbproc) {
$res = sybase_query("select * from F_CATALOG where CL_No=6 or CL_No=12",$dbproc);
if (! $res) {
/*echo "<pre>";
echo "</pre>";*/
$arr = sybase_fetch_array($res);
//echo $arr["CL_No"]."<br>";
//print $arr["ContentId"] . " " . $arr["v"] . "<br>\n";

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tgunduzAuthor Commented:
We finally found the solution
in order to use sybase php must be built with SOAP ....
$dbproc = sybase_connect("server","test","test");

So we used sql connect and all function like a charm

thank you

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.