4

I am new to PHP..... (In Eclips IDE) If i run the PHP code with Run As --> "PHP Script", that will work fine but Run As --> "PHP Web Page" is throwing the error as

Object not found!
The requested URL was not found on this server. 
If you entered the URL manually please check your spelling and try again. 

If you think this is a server error, please contact the webmaster. 

Error 404
localhost
03/22/11 12:04:12
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 
OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8 

Please help me.... Gnanendra

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Gnanendra
  • 63
  • 1
  • 4

2 Answers2

4

If you are using XAMPP place your eclipse project workspace in the XAMPP\htdocs\ folder. if you use WAMP then place it in the WAMP\www\ folder. you'll find the XAMPP or WAMP folders in the directory where you have installed it.

for your reference: enter image description here

Maggie
  • 5,923
  • 8
  • 41
  • 56
  • Can I have more then 1 projects in htdocs directory(folder)..?? – Gnanendra Mar 22 '11 at 08:55
  • yes, you can have more than one projeccts in htdocs provided they are all in seperate directories. eg: to run each projects; in the browser just type the directory name; http://localhost/project1/, http://localhost/project2/,.... – Maggie Mar 22 '11 at 09:34
1

Are you using any XAMPP or WAMP service? Did you place your files properly? It says the apache could not find your file. i.e. you've either not configured your environment properly or your file is at a wrong place.

J Bourne
  • 1,409
  • 2
  • 14
  • 33
  • 1
    Yes i have installed XAMPP, which contains Apache, MySql and php. – Gnanendra Mar 22 '11 at 06:40
  • 1
    The your file must be at wrong place. is it under htdocs directory. Your eclipse workspace also need to be set here. – J Bourne Mar 22 '11 at 06:42
  • 1
    Yes, my eclipse workspace is not under htdocs directory, its in other then "C" drive. And please could you tell me the path of the htdocs directory. – Gnanendra Mar 22 '11 at 06:56
  • 1
    You can set the path to htdocs in XAMPP, too. So you don't have to move your Eclipse project... – strauberry Mar 22 '11 at 08:06
  • please could you explain me, that how to set the path to htdocs in XAMPP – Gnanendra Mar 22 '11 at 08:49
  • 1
    you may refer this question: [Make XAMPP/Apache serve file outside of htdocs](http://stackoverflow.com/questions/1408/make-xampp-apache-serve-file-outside-of-htdocs) – Maggie Mar 22 '11 at 09:44