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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:58:34+00:00 2026-05-22T12:58:34+00:00

I have a folder that contains 1000+ sub folders. In each subfolder there are

  • 0

I have a folder that contains 1000+ sub folders. In each subfolder there are 1-800 images, plus a thumbs folder with the same number of smaller versions. In total there are around 18000 photos and 18000 thumbs

I have created a script to run occasionally to check if everything is present (all paths, folders and photo names are stored in database).

Using either file_exist() or is_file(), plus clearstatcache(), I run a loop to my db records to check if everything is ok.

To check if the script actually works, I have included a check field in my table structure:

photo_present, SET(Y,N)

Each time I run the script each photo validated will have the photo_present flag set to Y.

After only a few records, 300-800, the script gives an internal server error 500.

I checked my table and I know that the script has run for a while since I see the photo_present field is set to Y.

My question is how to optimize it so either file_exist() or is_file() will continue to work until all the files have been checked?

  • 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-22T12:58:34+00:00Added an answer on May 22, 2026 at 12:58 pm

    How are you running the script? If it’s by hitting the web page, it could be that your server caps the runtime of a script at 30 seconds or so and is killing PHP after that time, resulting in an Internal Server Error. The same could be true if it’s being run via cron, but that’s less likely.

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

Sidebar

Related Questions

I have a folder X:/EmpInfo that contains many different folders. Each of these folders
I have a folder/directory that contains some sub directories. Only those sub folders contain
I have a folder that contains more than 200K images. Some images will follow
I have a folder C:\Scripts. In that folder I have 2 sub folders, Procedures
I have a folder that contains about 100 txt files with information in each
I have a folder structure that contains multiple javascript files, each of these files
I have a script that is copying a folder that contains a couple sub
I have a folder A that contains folders B and C A--B C--| --|mat
I have a folder App\ressources that contains all the images, javascript library of the
I am working in ubuntu, I have a folder that contains a subfolder. in

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.