Jump to content

PHP Fatal Error: Trying to Allocate Immense Amounts of Memory


starhelix

Recommended Posts

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!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.