I have a problem getting my PHP to run from my website subfolders.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TyroneE
    New Member
    • Sep 2010
    • 5

    I have a problem getting my PHP to run from my website subfolders.

    Hi guys.

    I am having a major issue with getting my PHP files to run from the web server sub folders. Works fine under the root but if it is moved into a subfolder it stops working.

    There are a number of blogs, etc that try to exaplain how to fix but I am trying to get a basic fix.

    1. Is it a server security setting?

    2. Is it some code I need to add to my pages if they move to a sub folder?

    3. If 2 then where exactly do I put the code?

    Thanks to anyone who can help.
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    #2
    Are you getting any error messages? If so can you post the code related to the error message (please do not post the entire page of code, we should be fine with a few lines before and after any error lines.)

    Can you post links to example pages of the same code running from the root and from a subfolder. For example, make a page that simply prints "Hello World" and put one copy in the root, and another in a subfolder, then post links to both here.

    I wish I could help more, but without more information there's really nothing I can do, I've never heard of this before.

    Comment

    • TyroneE
      New Member
      • Sep 2010
      • 5

      #3
      Hi

      I get the below error on my browser when trying to open the file:

      Internal Server Error

      The server encountered an internal error or misconfiguratio n and was unable to complete your request.

      Please contact the server administrator, webmaster@365go lfers.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

      More information about this error may be available in the server error log.

      Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
      Apache mod_fcgid/2.3.5 mod_auth_passth rough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.365golfers.com Port 80



      Very strange.

      Comment

      • HaLo2FrEeEk
        Contributor
        • Feb 2007
        • 404

        #4
        Copy the following code:

        Code:
        <?php
        echo "Hello World!";
        ?>
        and paste it into a new file called "test.php" (without the quotes.) Save that file to your root and then also to a subfolder named test. So you should have something like this:

        Code:
        Root
        |-test.php
        |-/test
          |-test.php
        Then post links to both here, I'd like to look at this firsthand.

        Comment

        • TyroneE
          New Member
          • Sep 2010
          • 5

          #5
          Hi there

          This seems to work so I assume it must be something in my code on the other pages. I have been creating this for some time now so maybe the header needs to change? I'm just guessing.

          Here are the links:http://www.365golfers.com/test.php

          Comment

          • TyroneE
            New Member
            • Sep 2010
            • 5

            #6
            It seems to be my folders. I created another folder and copied the php files that were not working in a previous folder into the new one and now they work fine!?!?! Very confusing. Will copy a batch across and do a proper test. May be the easiest fix solution ever.

            Comment

            • HaLo2FrEeEk
              Contributor
              • Feb 2007
              • 404

              #7
              Sounds like it could be an .htaccess issue, if you're running on a *nix server. If you're running on Windows then I really don't know. I'm glad that you discovered potential solution though.

              Comment

              • TyroneE
                New Member
                • Sep 2010
                • 5

                #8
                Very strange situation. I'll recreate the folders and copy files across again. Thanks for your help.

                Comment

                Working...