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 183729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:10:03+00:00 2026-05-11T15:10:03+00:00

I am working on an image upload script and ran into this problem. Using

  • 0

I am working on an image upload script and ran into this problem. Using ImageMagick I would run out of time resizing and uploading images so I inserted these two lines:

set_time_limit(120); ini_set('max_input_time', 120); 

Now however, the script never ends. It is continually running the page even though it uploads, resizes, and inserts to the database fine. Do these conflict with each other in some way? It even goes past the 120 seconds I set as the time limit.

Edit: This is the full image editing portion of the script, it works with say 1 or 2 images but when I put in more (thereby making it take longer) it does not.

set_time_limit(120); ini_set('max_input_time', 120); $resource = NewMagickWand();  MagickReadImage($resource,$image);  MagickSetImageCompressionQuality( $resource, 100); $resource = MagickTransformImage($resource,'0x0','660x500');  MagickWriteImage($resource, $image); DestroyMagickWand($resource); 

This is the code I use to read all the images that are to be uploaded: (reSizePic is the function that calls the code above)

$numberImages = count($_FILES['galFile']['name'])-1;      for($i=1;$i<=$numberImages;$i++)     {     $imageName = $_FILES['galFile']['name'][$i];                 $imageType = $_FILES['galFile']['type'][$i];                 $imageSize = $_FILES['galFile']['size'][$i];                 $imageTemp = $_FILES['galFile']['tmp_name'][$i];                 $imageError = $_FILES['galFile']['error'][$i];                  //Make sure it is an image                 if(in_array(end(explode('.', $imageName)), $allowed))                 {                      //Where to upload image to                      $uploadFile = $uploadDir . $imageName;                      if (file_exists($uploadFile))             {                 //What to do if file already exists                 //Append random number to the end                 $front = explode('.', $imageName);                 $randomNum = rand(1,100);                 $front[0] = $front[0].$randomNum;                 $imageName = $front[0].'.'.$front[1];                 $uploadFile = $uploadDir . $imageName;             }                       if(move_uploaded_file($imageTemp,$uploadFile))                       {                       //Add $imageName to DB                        $query = 'INSERT INTO galleryImages VALUES(\'0\',\'$lastInsert\',\'$imageName\',\'$i\')';                    mysql_query($query);                    reSizePic($uploadFile);                       }                 } 

Levi

  • 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. 2026-05-11T15:10:04+00:00Added an answer on May 11, 2026 at 3:10 pm

    You should make sure to only call set_time_limit() once, as each time you call it, the timer will be reset.

    For instance, if you call set_time_limit(30) 10 seconds in to your script, your script will run for a total of 40 seconds. So setting it on each resizePic() call is a bad idea.

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

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I have an ASPX page where I am uploading an image to server for
I am working on a building a gallery and the goal is a low
I am working on a mobile application in .NET. This is a windows mobile
I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.