Error when PHP file isn't run from www folder
Posted by: jalabi99 (209.212.25.---)
Date: November 02, 2007 05:17PM

I installed WAMP5 and left everything as the default (folder to install the files, etc.) It said that if I put a PHP file in the root folder of the installation (i.e. the "www" folder) or if I put a folder in the www folder, I could run a PHP file from there.

I created a folder "mycode" in the "www" folder which contains a bunch of PHP files including "index.php", and typed the following into the browser:

[localhost]

and the program gave an error ("Internal server error 500"winking smiley. But when I copied the "index.php" file from "mycode" to "www" and typed

[localhost]

it worked as intended.

I don't want to have to copy all the files from "mycode" to "www" in order for the code to work. What can I do?

Win XP Home SP2
WAMP5

Options: ReplyQuote
Re: Error when PHP file isn't run from www folder
Posted by: yfastud (---.mia.bellsouth.net)
Date: November 02, 2007 07:37PM

It's not the file index.php give you the error, but might be some other file that conflict w/ this index.php, so check to make sure it's not the case; also, if you have .htaccess in that "mycode" folder, check to make sure all rules are accessible w/ this wamp

Have fun,

[test.jlbn.net] (Sample Testing Codes for PHP, MySQL, ASP.net, SQL, JSP)
[www.jlbn.net] (Basic Guide for WAMP & Add-ons)

Options: ReplyQuote
Re: Error when PHP file isn't run from www folder
Posted by: CyberSpatium (---.hsd1.mn.comcast.net)
Date: November 03, 2007 02:24AM

in order for your php code to work, it needs to be parsed by apache. apache can only process php files where it expects them (DocumentRoot setting). So, they need to be put in the c:\wamp\ww folder.




CyberSpatium
----------------------
WAMP English Forum Admin

I have WAMP5 working with (for development use only):
Windows Vista Ultimate x64 (64 bit)
Kaspersky Internet Security Suite 7.0.x
Spyware Terminater 2.x
CounterSpy 2.5.x


Need help? Check out my WAMP User Manual/Guide here!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote


Sorry, only registered users may post in this forum.