Get 404 when running .php project [message #725455] |
Wed, 14 September 2011 16:38  |
Eclipse User |
|
|
|
Hi,
just installed PHP Dev tools into my eclipse. Which works fine in java mode.
Wrote the 'echo "Hello World!";' php file and ran it as a Web Page. I got an 'HTTP 404 can't display web page' error. The built in browser(?) was trying to load 'localhost/test1/hellox.php'. This might work if localhost == C:/Users/Suzanne/Workspace/ but I suspect it's just = 127.0.0.1
I put 'C:/Users/Suzanne/Workspace/test1/hellox.php' in the URL and then got a 'HTTP 403 don't have permission to read this location' message. I think this could be a Windows 7 thing on the C:.
Question: what do I have to tweak to get the 'run as a web page in the built in browser' to work properly/find the right file?
The hellox.php file works fine when put in the right place for my Apache to find it. I'm running Windows 7 SP1.
Many thanks,
Suzanne.
|
|
|
|
|
|
Re: Get 404 when running .php project [message #734613 is a reply to message #725874] |
Sat, 08 October 2011 17:59  |
Eclipse User |
|
|
|
Hi Suzanne:
I just installed XAMPP and the PHP development tools on my system which is also running Windows 7 SP1. Everything looks fine until I attempt to run the project's Index.PHP file as a "Web Page". What appears in the Eclipse browser is a 404 error. I believe the 404 error is due to the fact the Eclipse internal browser is NOT including the Eclipse Workspace folder as part of the URL. In my case, the Index.PHP file is located in the "C:/xampp/htdocs/joomla_development/Joomla 1.5 Source" directory, but the internal browser is requesting to display "http: //localhost/Joomla 1.5 Source/index.PHP". When I execute PHPINFO() the "Document_Root" value is "c:/xampp/htdocs/" which explains the 404 error.
I don't know if the error is being caused because the Eclipse Project Wizard is creating the source file in a sub-directory or because there is no way to alter the value being used by the internal browser for the "localhost" variable. I tried to change the Apache server's "Document Root" value but then the Xampp PHP files obtain a 404, since PHP is no longer looking in "C:/xampp/htdocs" as the location for it's PHP and HTML files.
I also attempted to update the "Document Root" location for the default web server in the Window -> Preferences -> PHP -> PHP Servers dialog by selecting the only listed server and then the "Edit" button. This brought up a dialog box that contains a field entitled "Enter the URL that points to the document root of this server" which has a default entry of "http: //localhost". However, when I entered "http: //localhost/joomla_development" I obtained the following error:
Please enter a valid Server URL (<protocol>://<server url>:[:<port>])
Additionally, if I attempt to run the Index.PHP file on a server I obtain the error "The selection does not contain any resources that can run on a server".
If anyone in the forum has a solution for this problem, please post it as I am just beginning to use the Eclipse platform and am not sure where to look on the Internet for a solution.
|
|
|
Powered by
FUDForum. Page generated in 0.03564 seconds