English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am trying to learn Php. Today I installed the Apache Http Server 2.2 on my Windows XP system. I then installed Php-5.2.1-win32.zip.

Currently if I go to http://localhost/ it displays the "it works" screen for apache but I created a simple file called hello.php and saved it to the htdocs dir. however when I try to open the site http://localhost/hello.php it just gives a blank screen.

Anything extra I need to do or what am I doing wrong?

2007-03-17 10:49:01 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

If it were me, I would put a standard ol html file in the directory first and be sure it shows. Just to be sure I am using the correct directory. (Been awhile since I used winduhs yep I said winduhs for this)

I would check your php.ini file and see if it is setup properly. The default may not be correct for your computer. So the php may not be working.

Second be sure apache config file has php turned on.
If not you need to enable it and restart apache.
The line will look something like
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php

Third - recheck your hello.php and be sure you entered the script correctly (I know you did, but I have failed to close a tag or two in my life.)
Fourth, I'd drag out an ol machine, load it with LAMP (linux, apache,mysql, php) and use it for the server! :)

Actually you are 98% to having this work when the Apache page shows.

2007-03-17 11:01:44 · answer #1 · answered by Tracy L 7 · 0 0

open the file "hello.php" and type in the following

phpinfo();
?>
save it and try running http://localhost/hello.php again from your browser.

this will give info about whether php is working on the system and what are the spefications of it...try making new php files try out new code. If you already have some stuff wirtten in php in the hello.php file, then make sure the syntax is correct, tags are closed, etc...

for more info on php goto php.net or try some tutorials on http://www.w3schools.com/php/default.asp

If you have problems installing and configuring apache and php, etc...goto www.apachefriends.org/en/xampp.html and download the software called "XAMPP". It will install Apache, PHP, MySQL, PHPMyAdmin, Filezilla on your machine automatically without any work on your side!

2007-03-17 11:06:40 · answer #2 · answered by Anonymous · 1 0

Very Easy......so easy it hurts. Unless you want to learn how to set this up from scratch.....let us know and there are articles on getting this up and running.

http://www.wampserver.com

The download includes Apache, MySQL and PHP all packaged into a single download.......best thing is that it "works out of the box"!! You must uninstall what you already did.

The last release uses the most recent releases of all 3 products

WAMP=Windows, Apache, MySQL and PHP

Have fun with it...........

2007-03-17 16:19:09 · answer #3 · answered by Jeffrey F 6 · 0 0

You will have to configure httpd.conf file in Apache to run php files. Please check install.* file in php directory to learn what configurations do u need to run it.

On the other hand, I would like to recommend u to use any pre-configured package. I had used WAMP ( http://www.wampserver.com ) and XAMPP ( http://www.apachefriends.org ). I prefer XAMPP because it comes with most advanced features.

2007-03-17 21:04:18 · answer #4 · answered by Atif Majid 3 · 0 0

fedest.com, questions and answers