Torrrd
Torrrd

Reputation: 11

Fatal error: Allowed memory size of 419430400 bytes exhausted (tried to allocate 251268854 bytes) in /home/apartmen/php/HTTP/Request.php on line 1012

Ok, I know how this question has been asked and all. But, heres the thing.

  1. I'm already using ini_set('memory_limit', '400M');
  2. The file I'm trying to transfer (to Amazon S3) is 245MB
  3. The error msg is weird, says allowed mem of 400MB exhausted when it was trying to allocate 239MB.. isnt that the other way round?

The script I'm using is a library out there, to communicate with the Amazon S3

Help please!

EDIT
Ok heres the code, as you can see I'm not doing much, its all about the script I'm using.. That is here: http://belgo.org/backup_and_restore_to_amazo.html

ini_set('memory_limit', '400M');
require 'lib/s3backup.php';
$bucket = 'thebucketname';
$bucket_dir = 'apts';
$local_dir = "/home/apartmen/public_html/transfer/t/tr";
$s3_backup = new S3_Backup;
$s3_backup->upload_dir( $bucket, $bucket_dir, $local_dir );

Upvotes: 1

Views: 2991

Answers (2)

Ryan Parman
Ryan Parman

Reputation: 6935

The AWS SDK for PHP has an AmazonS3 class that can stream a local file up to S3.

http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#m=AmazonS3/create_object

The parameter you need to pay attention to is "fileUpload".

Upvotes: 0

Mark Baker
Mark Baker

Reputation: 212402

"allowed mem of 400MB exhausted when it was trying to allocate 239MB.." means that PHP was trying to allocate an additional 239MB of memory that (when added to the memory already allocated to the script) pushed it over the 400MB limit.

Upvotes: 4

Related Questions