starhelix Posted March 22, 2008 Share Posted March 22, 2008 Hey Everyone, I just installed ssh2 support for php on my Fedora Core 6 box with php 5.1.6. When I attempt to connect to MOST servers, it works as intended. However when I try to connect to one specific server, I get a fatal error. It seems that it attempts to allocate nearly all of my physical memory. My code looks as such: <?php if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist"); // log in at server1.example.com if(!($con = ssh2_connect("rfsmsc3.com", 3128))) { echo "fail: unable to establish connection\n"; } else { //do other stuff... And the error I receive is: PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 1011373056 bytes) in /var/www/html/phpsshtest.php on line 6 As you can see, it attempts to allocate over a gigabyte of memory when executing line 6 ($con = ssh2_connect() command). The only difference I notice between the servers that work and the one that doesn't is the port number (22 vs 3128). I have searched google and found nothing thus far. Any help would be appreciated!! Link to comment https://forums.phpfreaks.com/topic/97307-php-fatal-error-trying-to-allocate-immense-amounts-of-memory/ Share on other sites More sharing options...
cooldude832 Posted March 22, 2008 Share Posted March 22, 2008 Where it is pointing must have some infinite loop issue or something. Link to comment https://forums.phpfreaks.com/topic/97307-php-fatal-error-trying-to-allocate-immense-amounts-of-memory/#findComment-497982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.