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 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, c:\websites\test , and it contains folders and files that were
I have a folder in NTFS that contains tens of thousands of files. I've
I have a VS solution that contains 6 library projects and 1 web folder
We have PHP 5.2.6 deployed to c:\php and in that folder there is the
There is a folder that contains 1000s of small text files. I aim to
I have a Folder in ClearCase that contains a large list of Reports. I
I have a folder that is my working copy. How do I remove all
I would like to create a folder that users who do not have privileges
How can I have it so Visual Studio doesn't keep re-creating this folder that
I have a Java application that monitors a folder for incoming XML files. When

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.