dscuber9000 Posted April 8, 2008 Share Posted April 8, 2008 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 http://127.0.0.1/. 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. Quote Link to comment Share on other sites More sharing options...
trq Posted April 8, 2008 Share Posted April 8, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.