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

  • SEARCH
  • Home
  • 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 8728149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:33:59+00:00 2026-06-13T08:33:59+00:00

I have a few questions that I have been searching answers for. 1: Php

  • 0

I have a few questions that I have been searching answers for.

1: Php memory allocation.

If I have a 1 megabyte variable $img =file_get_contents('imageUrl');

and my php memory allocation is 64 megabytes, and 100 people are accessing the script at the same time, Is that going to cause a memory allocation error?

2: How would I better save an image from a url?
I am getting a memory allocation warning…

if ($fileName){
    //check to make sure filename is not taken
    if(!file_exists("img/".$fileName.$fileExt)){
            $image = file_get_contents("someURL".$fileName.$fileExt);
        //check to make sure the filesize is not rediculous 8 Megabytes.
        if(strlen($image) < (8 * 1048576)){                     
            if(file_put_contents("img/".$fileName.$fileExt, $image)){
                usleep((0.25 * 1000000)); //rest 1/4 second
                    if(!image_resize("img/".$fileName.$fileExt, 202, 202, 1))die('no rezize');
            //PRETEND THERE ARE CLOSING CURLY BRACES THANKS
  • 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-06-13T08:34:01+00:00Added an answer on June 13, 2026 at 8:34 am

    Assuming you are talking about the memory_limit configuration directive, that is a limit on the amount of memory each script execution can consume, so the limit is 64M per user accessing concurrently, rather than 64M total for all users simultaneously and you would not exceed it. Its purpose is to prevent, for example, one script attempting to resize a giant image that requiring hundreds of Megabytes of memory to complete, or a runaway loop accumulating a big data string without terminating, not to place a cap on possible concurrent access.

    This is not to say that you could not exhaust the server’s available memory with too much concurrency on a script though. In that case, the server would likely start paging, and have a very negative effect on performance. It should not error and stop responding to requests, however.

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

Sidebar

Related Questions

There have been a few questions that are similar but are either too broad
I'm new to MySQL and have a few questions that I haven't been able
I've been reading about reliable messaging and have a few questions that I haven't
I have a few questions about PHP memory usage. I'm going to run some
I have a few questions that will help me understand things better if answered:
I have a few questions that I hope clarity and facts can be fed
Sorry guys, I hate asking dumb questions but I have seriously been searching for
I have a few elementary questions about cURL that I can't find answered in
For the last few hours I have been searching high and low for a
Im a newbie PHP programmer and I have a few questions about creating a

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.