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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:07:56+00:00 2026-05-26T23:07:56+00:00

I am running a website where we are serving a large amount of files

  • 0

I am running a website where we are serving a large amount of files from a folder mounted over Fuse (cloudfuse – a Rackspace Cloudfiles container), it works wonderfully most of the time however every now and again the Fuse connection stalls and all my Apache processes hang waiting for a file_exists() function to return.

My question, is there anyway to set a timeout for a specific function or to use another function to check if the file exists but return with false if function takes longer than x seconds?

  • 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-26T23:07:57+00:00Added an answer on May 26, 2026 at 11:07 pm

    I think file_exists() is only simple function, and is not intended for such operations.

    Workaround #1 (quite elegant)

    • make a batch file which is checking is file exists
    • use system() function to execute your batch file and parse result

    Workaround #2 (simpler, not elegant at all)

    • make a script file_exists.php?file=… returning string “TRUE” or “FALSE” if file $_GET[‘file’] exists. Set time_limit in this file to 1 second.
    • get results using fsockopen(‘http://localhost/file_exists.php?file=’.$file, …, …, 2) and parse results. (empty or FALSE = file doesn’t exists). 2 is fsockopen’s timeout. You can use system(‘/usr/bin/php /path/to/your/script.php’) as well
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume you are running a pure-HTML website on Apache. Just serving static files, nothing
i m running a website from a global webserver and a wants to store
I have a website running on a Windows 2003 server on IIS 6, serving
We got a long-running website where XSS lurks. The problem comes from that some
I am running a website locally. I have one main folder, which contains all
I currently have an internal website that is running Apache. It is serving some
I have a running website on wordpress which has been hacked, some file were
I have a running website and now i like to use WP for a
I have a website running Joomla! (it's not mine, so I don't know how
I am running a website on shared hosting at GoDaddy (not my choice, because

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.