views:

37

answers:

1

I want to run a PHP file as a web page in Eclipse, but every time I try to run it, I get a "404 not found error". I'm using the default PHP Web server in the run configuration. Here's a screenshot of how I got it configured... What am I doing wrong?

Thank you

A: 

Troubleshooting:

  • Is your webserver running?
  • Have you tired access to localhost trough your browser? Output?
  • Have you tried access to localhost/First_PHP_Project/newfile.php? Output?
  • Try to remove the slash in the front of /First_PHP_Projcet
  • Do you use any proxies?
erenon
Yes my webserver is running, I've tried accessing the localhost through my browser and I get an "It works!" message. ON the other hand when I tried to access "localhost/First_PHP_Project/newfile.php" I get the follo0wing output:Not FoundThe requested URL /First_PHP_Project/newfile.php was not found on this server.Apache/2.2.12 (Ubuntu) Server at localhost Port 80I don't use any proxies.
Fez
@Fez: Then please check the content of your DocumentRoot (e.g: /var/www/)
erenon
There's only one file at that location, it's the html file of the message that I got when I ran the localhost from my browser. Should there be more files in the folder?
Fez
@Fez: If you'd like to run/debug newfile.php, yes, you have to got newfile.php.
erenon
Ok. Is there any way to add the path of my existing eclipse project to the Web Server path?
Fez
@Fez: You could create a symlink ($ man ln) or just remove by refactor your whole project. On dev computer it's ok to work in the DocumentRoot.
erenon
ok, thank you very much for your help!!
Fez
@Fez: Please, mark this answer as accepted, if it was helpful.
erenon