473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Sep 7 '10 #1
7 1271
HaLo2FrEeEk
404 256MB
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.
Sep 8 '10 #2
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 misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@365golfers.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_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.365golfers.com Port 80



Very strange.
Sep 9 '10 #3
HaLo2FrEeEk
404 256MB
Copy the following code:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. echo "Hello World!";
  3. ?>
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:

Expand|Select|Wrap|Line Numbers
  1. Root
  2. |-test.php
  3. |-/test
  4.   |-test.php
Then post links to both here, I'd like to look at this firsthand.
Sep 9 '10 #4
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

http://www.365golfers.com/test/test.php
Sep 9 '10 #5
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.
Sep 9 '10 #6
HaLo2FrEeEk
404 256MB
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.
Sep 9 '10 #7
Very strange situation. I'll recreate the folders and copy files across again. Thanks for your help.
Sep 9 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Kali K E | last post by:
Hi, I could not understand how I can do the following things in Python. Please help me. 1. First I have to find the current directory from where the script is invoked. 2. Next I have to form a...
2
by: iainw | last post by:
HI All, 1st post here, i wonder if you can help. We are about to upload CMS t a windows server and keep getting 2 errors below. We need to go LIVE an it's delaying us. An error occured when...
9
by: Tom | last post by:
How do you programatically get a list of subfolders in a folder? Thanks! Tom
3
by: TK | last post by:
Excuse me for multiple posting because I've posted this message to aspnet.security NG but have not got any response yet. I'm building an ASP.NET application works in Forms Authentication mode...
9
by: Bill Nguyen | last post by:
I need a VB routine to loop thru a select top folder to find all subfolders and list all subfolders/files under each of these subfolders. Any help is greatly appreciated. Bill
9
by: freduchi | last post by:
Hi, I need sugestions. I need to implement the next and I don´t know how to do it: I am developing a website in which users are signed up and share information(Messages, Photos...). When a...
0
by: Torben Laursen | last post by:
Hi My asp.net website is using a c++ dll that I have written. But where should I place it so I don't have to hardcode the path in the c# code? It is used by code that is inside the App_Code...
3
by: mrajanikrishna | last post by:
Hi friends, I've designed an application in my local system using VS.NET 2003. (VB.NET and ASP.NET) Its working fine. Now, I want to publish to my ISPs server. I've FTP account. How can I...
0
by: deve8ore | last post by:
Hi.... I'm getting closer to understanding the wildcard function in VBA, however we have a vendor that will supply us many files, and unfortunately will place them in different folders with no...
2
by: jeddiki | last post by:
Hi, I have made a little web page that contains an article about getting website traffic. For some reason the text is getting pushed over to the right hand side. This is my css for that text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.