0

I'm getting this problem while trying to run any query against Sybase from php:

  • PHP 5.4.3 (cgi-fcgi) (built: May 9 2013 17:03:23)
  • built --with-sybase-ct=/path/to/freetds
  • code:

    <?php
    $con = sybase_connect('server', 'user', 'pwd'); //connects fine
    $q = sybase_query("select col=1", $con);        //error here, regardless of SQL
    ?>

  • Output:
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 30064771074 bytes)

Any ideas ?

Dmitry z
  • 4,533
  • 4
  • 15
  • 15

1 Answers1

0

try to add this to your code :

<?php
    ini_set("memory_limit","128M");
    $con = sybase_connect('server', 'user', 'pwd'); //connects fine
    $q = sybase_query("select col=1", $con);        //error here, regardless of SQL
    ?>
Mehdi Karamosly
  • 5,388
  • 2
  • 32
  • 50
  • 128M didn't help. I looked at the error message (tried to allocate part) and gave: ini_set("memory_limit","30G"); That helped, but why in the world would it require 30G to query ?? – Dmitry z May 15 '13 at 15:06
  • There should be a problem in your query, try to optimize it, what are you trying to achieve with `select col=1` ? should you specify a table and a database first ? – Mehdi Karamosly May 15 '13 at 15:23
  • 'select col=1' is a valid sql that should return 1 row. I'm just using it as an example that can be easyly reproduced. Like I stated in my post, I'm getting the same error message regardless of the SQL used. – Dmitry z May 15 '13 at 17:27