• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 713
  • Last Modified:

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

1 Solution
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now