Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3441618
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:34:29+00:00 2026-05-18T08:34:29+00:00

I have a hefty PHP script. So much so that I have had to

  • 0

I have a hefty PHP script.

So much so that I have had to do

ini_set('memory_limit', '3000M');
set_time_limit (0);

It runs fine on one server, but on another I get: Out of memory (allocated 1653342208) (tried to allocate 71 bytes) in /home/writeabo/public_html/propturk/feedgenerator/simple_html_dom.php on line 848

Both are on the same package from the same host, but different servers.

Above Problem solved new problem below for bounty

Update: The script is so big because it rawls a site and parsers data from 252 pages, including over 60,000 images, which it makes two copies of. I have since broken it down into parts.

I have another problem now though. when I am writing the image from outside site to server like this:

try {
    $imgcont = file_get_contents($va); // $va is an img src from an array of thousands of srcs
    $h = fopen($writeTo,'w');
       fwrite($h,$imgcont);
       fclose($h);
    } catch(Exception $e) {
    $error .= (!isset($error)) ? "error with <img src='" . $va . "' />" : "<br/>And <img src='" . $va . "' />";
    }

All of a sudden it goes to a 500 internal server error page and I have to do it again, at which point it works, because files are only copied it they don’t already exist. Is there anyway I can receive the 500 response code and send it back it to the url to make it go again? As this is to all be an automated process?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:34:30+00:00Added an answer on May 18, 2026 at 8:34 am

    Thanks for all your input. I had seperated everything by the time I wrote this question, so the crawler, fired the image grabber, etc.

    I took on board the solution to split the number of images, and that also helped.

    I also added a try, catch round the file read.

    This was only being called from the browser during testing, but now that it is all up and running it is going to be a cron job.

    Thanks Swish and Benubird for your particularly detailed and educational answers. Unfortunately I had no cooperation with the developers on the backend where the images are coming from (long and complicated story).

    Anyway, all good now so thanks. (Swish how do you call a script from the command line, my knowledge of this field is severely lacking?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a fairly hefty cube that won't be much good without aggregations.
I have a script that appends some rows to a table. One of the
Basically, we have an ASP website right now that I'm converting to PHP. We're
I have a hefty db server with lots of very similar InnoDB databases. A
We have a fairly hefty VS2008 solution that comprises of many library projects that
I have a program that makes some hefty calls to the database and then
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
Possible Duplicate: PHP make if shorter I have an if statement that looks like
Say I have a fairly hefty JavaScript file, packed down to roughly 100kb or
Have you ever seen any of there error messages? -- SQL Server 2000 Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.