Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Not recognized inside folder

Status
Not open for further replies.

Nilgni

Instructor
Feb 21, 2002
58
US
I am having trouble getting a page to see any php. If I put the page in the root of the site - no problems, but inside a folder it ignores the code entirely.
Suspect that there need to be an inclusion to activate php inside the folder but have no clue on how to implement that. Searched online and see there is a possibility to edit the htaccess file inside the folder but the explanation did not include any type of example.
Your help is appreciated greatly.
Thanks Keith
 
How are you attempting to run the page with PHP inside the folder?

When placed inside the folder, does the file have execute permissions?



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
I created a php message system using MYSQL on my host. I am trying to use it on a new host (that I have newly been asked to work on for a company I am associated with).
Rather then mix my multiple files with the Joomla system that is already in place, I placed all of my files in a folder on the root.

I typically have an include that points to the connection string and the pages are loading, but there is no indication of any php being read.. after seeing that I simple put and echo statement at the top of page.
Code:
echo "HI";
die(); 
?>
If the page is in the folder - nothing.. if I place it in the root the page executes the statement and stops loading as expected.

Sorry that I don't quite understand what you are saying as far as execute permissions.. Do you mean that I have to go the file manager and add execute permissions to the folder? If so I have done that in the past on my hosts and I am sure that I can do it here as well.
 
I did change the permission on the main folder. There were no parameter that included sub folders and file (at least as far as I can see with this host). The permission change did not change the function of the page. The identical page on the root works, the file inside the folder - nothing.
 
Check the root .htaccess file to see if it has any <files> directive that prohibit files extensions from being executed in some folders

The Joomla .htaccess file may also be redirecting your sub directory to somewhere or nowhere, test the status headers that your script URL returns.

Putting arbitrary files and folders in the document root of any CMS system can have unexpected results because of the global rewrites/redirects implemented by the CMS.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I agree with Chris its more likely to do with how the Joomla system is handling the URL requests to folders off the root than PHP itself not running.

If there was an issue with PHP not running, you would at least see the text and code from the file in the browser. Since you see nothing, it suggests the file in the folder is not even being read.

Take a look at the .htaccess file in the root of the server if there is one. You may need to add a rule there for the folder you created to be properly redirected.

i.e:
Code:
RewriteCond %{REQUEST_FILENAME} !\/[COLOR=#4E9A06]foldername[/color]\/





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top