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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:49:56+00:00 2026-06-05T02:49:56+00:00

I am going crazy with this one I have this folders and files structure

  • 0

I am going crazy with this one

I have this folders and files structure

  • /
    • /projects
      • /mytest
        • /install
          • /index.php
        • /product
    • /resources

So, inside my install/index.php file I am trying to verify if /product folder does exist. I know that the folder exists, but looks like PHP doesn’t. My code:

if(file_exists('../../mytest/product') && is_dir('../../mytest/product')) {
    echo 'Folder exists!';
} else {
    echo 'PHP is blind or something!';
}

Maybe I am very tired, but I just cannot figure out what is wrong. Some rested minds here maybe will see the problem. 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-05T02:49:58+00:00Added an answer on June 5, 2026 at 2:49 am

    With your current directory structure:

    /
        /projects
            /mytest
                /install
                    /index.php
                /product
        /resources
    

    The following code works just fine:

    <?php
    if(file_exists('../product') && is_dir('../product')) {
        echo 'Folder exists!';
    } else {
        echo 'PHP is blind or something!';
    }
    ?>
    

    As does your current code:

    <?php
    if(file_exists('../../mytest/product') && is_dir('../../mytest/product')) {
        echo 'Folder exists!';
    } else {
        echo 'PHP is blind or something!';
    }
    ?>
    

    Both solutions outputted “Folder exists!“, so the issue is related with folder permissions.


    You need to confirm:

    • Owner for that folder

    Remember that the owner of the directory has to be the same of the script user, otherwise this function will always return false when PHP is running in safe_mode..

    • open_basedir

    Limit the files that can be opened by PHP to the specified directory-tree..

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

Sidebar

Related Questions

This one had me going crazy for awhile. I have an app that was
I'm literately going crazy with this one. I have been searching the answer and
Ok, I'm going crazy on this one. MySQL is throwing a fit about this
I am going crazy trying to figure this out without success. I have a
I'm going crazy. I have a dll, with this function : function MyFunc(myId: integer;
I am going crazy now. Googled this, thought some kind of IDE bug. Maybe
I've been driving myself crazy over the past few days over this one. We've
I am going to be crazy I think. Please Help. I have a table
Okay, this is driving me crazy right now. I want to have a border
Perhaps I'm going crazy here, but I have a desktop mac application which, 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.