PHP Not Working on My Computer

I am working through Sitepoint’s Build Your Own Database Driven Website with PHP and MYSQL. I am at chapter 3. I followed the installation instructions and installed PHP, MYSQL and APACHE individually. I did everything it asked. The problem I have is PHP does not seem to be working. When I go through the URL query string example in Chapter 3, the echo statement is not displaying anything. I checked the today.php script (which displays the time) we created earlier and the PHP is not working here either (in other words, it displays the HTML content but does not show the time). I have also uploaded a script of mine and all that is displayed is either a blank page for some pages and all the PHP stuff in plain text for other pages. This script works fine when I uploaded it to my host.

I have installed the following:

Apache HTTP Server 2.2.22 (httpd) - Win32 Binary without crypto (no mod_ssl) (MSI Installer)
MySQL 5.5.22 - Windows (x86, 64-bit), MSI Installer
PHP 5.3.10 - VC9 x86 Thread Safe

I am tempted to just install WAMP or something similar but I would much rather keep them individually installed and get to the bottom of this problem. Plus, I am not even sure how I would uninstall the individual packages.

My localhost is working on Windows7

I installed
Apache httpd-2.2.22-win32-x86-no_ssl.msi

MySQL mysql-essential-5.1.61-winx64.msi
I couldn’t get mysql-5.5.21-winx64.msi to work

PHP php-5.3.10-Win32-VC9-x86.zip not the installer

If you have Windows7 you could try those, though it sounds like you’re only having problems with PHP

You’ll never guess what. Installed WAMP and I have the exact same problem as before. Let me explain. I have this small script:

<p>Today’s date (according to this web server) is
<?php
echo date(‘l, F dS Y.’);
?>
</p>

But when I run the page today.php in my browser, all that it displays is:

Today’s date (according to this web server) is

No date.

I have also reinstalled my real estate script and once again the pages are either showing as blank or the php code is being shown as plain text. What has gone wrong?

When you installed WAMP, did you remove all traces of the previous installs first?

What file extension are you using?

you can use the following sites for the help in PHP.

http://www.onlyphp.com
http://php.resourceindex.com/
http://www.hotscripts.com/PHP/
http://phpbuilder.com/snippet/
http://php-scripts.com/
http://www.0php.com/
<snip/>
http://www.zend.com/zend/tut/
http://www.phpfreaks.com
http://codewalkers.com
http://www.faqts.com/knowledge_base/index.phtml/fid/51
http://www.phpclasses.org

It turned out I was using file://C/Wamp… instead of localhost for the file location. Sorted it now. Thanks for the help.