help on php

shivam99aa

Disciple
i am learning php nowadays.i have installed xampp in my system but the problem is that when i make any php page and put it in htdocs file of it and run it through my browser then nothing happened.only a error comes with file not found,now please help me that is there any special thing to do after writing php code please help me out.
 
by just typing http://localhost i get a page which shows something about xampp for windows.when i write any php code in txt and paste that file with php extension in my htdocs folder in my xampp file in c drive,say by a name echo.php and when i write http://localhost/echo.php in my web browser it gives an error mesage saying object not found which looks like this "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
16-05-2011 22:38:25
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 "
i want to know that writing php code in text document and just pasting it in htdocs is a legitimate way or i need to have anything special for doing this.help me out.
 
php files are text files with the php code so they can be made just like a text file.

for xampp, php files can be added to htdocs folder to get the required results.

check below simple php file (hello.php) to get "hello world" message.

Code:
<?php 

 Print "Hello, World!";

 ?> 

 <?php 

 Echo "Hello, World!";

 ?>

from your response, it appears that xampp is correctly installed and running.

may be this link helps : testing php with xampp
 
what you said i did the same. i write a text file with the code you was saying and save it with the name hello.php but the same error still persists.i dont understand why is this happening.
 
Even i am facing the same problem as the OP is facing, but mine is a problem at grassroot level. After running http://localhost/ i get an error as shown below


i installed IIS 7 on windows 7 and did everything possible to get the localhost starting(switching off apppool and turning on). Even i wanted to run php files but my localhost itself is not responding so cant execute .php files too..

after running eventvwr, i found the error under System and not application. The error states as below.



Now what should i do?? I even tried with xampp and easyphp but for both, my apache server does not start. I get an error port 80 is akready being used or being blocked by firewall(i checked my KIS and added port 80 to 'Allow') but still get an error.
 
what i was doing is that i was typing the wrong adress at my browser.when i type localhost it loads a page with url localhost/xampp.what i have to do is say to load a page echo.php i have to type localhost/echo.php but i was typing localhost/xampp/echo.php.
 
i have installed xampp previously but due to some reason i have to format my system and when i am again installing it into my system my apache service is not starting.it is giving an error saying port80 is already in use. i am not able to understand it.help me out.
 
Back
Top