Jump to content


I don't really know what I'm doing...

  • Please log in to reply
1 reply to this topic

#1 dscuber9000

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 08 April 2008 - 10:46 PM

I like to think that I'm good at HTML, Javascript, CSS, and all that, but I decided to try and learn PHP. I got this nice-looking PHP book, but even with an entire chapter dedicated to installing PHP, I just can't get it to work.

I downloaded and installed Apache. I ran apache.exe and typed in in the address bar of my Web Browser and I got the confirmation site saying a local server is running. Yay! Next, I went into Control Panel, Administrative Tools, and Services and saw that Apache is running as a service. Yay! Then I downloaded PHP 5.0 and copied a file called php.ini-recommended into my C:\WINDOWS directory and renamed it php.ini. The next step (and final step, according to the book) is where I seem to be stuck.

The book tells me to open a file called httpd.conf and add the following lines of "code" to it:
- LoadModule php5_module C:\Documents and Settings\HP_Owner\My Documents\php-5.0.0RC2-Win32\php5apache.dll
- AddModule mod_php5.c
- AddType application/x-httpd-php .php

Once I added those lines, I created an HTML file with some PHP code and the PHP code did not work. It was just the phpInfo(); function, so it's not the code's problem, I obviously messed up installing PHP. I have no idea what I did wrong.

#2 trq

  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 08 April 2008 - 11:13 PM

Firstly, when you make changes to the httpd.conf file you need to restart apache for the changes to take effect. You never mentioned restarting, so that the first thing I would do.

Secondly, php cannot run in files ending in the .html extension (well it can, but not with a default configuration) you file must be named *.php in order to be processed by php.

And thirdly, where did you place this file in order to view it? It needs to go in your servers DocumentRoot directory. You can find where this is by looking at this DocumentRoot directive within the httpd.conf file.

If your still having problems you might find installing something like xampp (google it) easier. This will install everything that is required to get started. Apache configured with php as well as the mysql server database you will eventually need.

Your trying to learn php after all, not server administration.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users