PHP code not working - it was a couple of weeks ago

I’ve been going through David Power’s book “PHP Solutions” and was successful with several chapters. I decided I needed more background in HTML and CSS so I went through a couple of those books. I’m now back trying to run my PHP programs again, but the PHP code isn’t executing.

The code is obviously ok or it wouldn’t have run initially. I’ve changed something in my setup, but I can’t figure it out.

Here’s my environment

Windows XP
XXAMP for Apache and Mysql
Komodo Edit 7.0 (free version)

Apache and Mysql are running, and I’m the only one on the PC. I haven’t touched any admin configuration or changed any passwords.

A simple example of my problem is this:

[php]<?php echo("Hello World!"); ?>[/php]

Nothing is displayed when I run it using Komodo’s browser preview and if I try to execute it from a browser (Chrome, IE, FireFox) it simply displays the code I’m trying to execute, like this: <?php echo("Hello World!"); ?>

All snickering in well deserved. But, what am I doing wrong?

Thanks

David Morris

  1. Make sure you have PHP installed with Apache. This doesn’t come defaulted See PHP For Windows since you’re on windows.

  2. Make sure your files are on the *.php file extension. Example: index.php

  3. You also don’t need the brackets around what you’re echoing:
    [php]

<?php Echo "Hello World!"; ?>

[/php]

Hi,

Thanks, but I’m pretty sure that’s not the problem.

If you’re not familiar with XAMPP, it configures everything when it’s installed and like I said my PHP code was working a couple of weeks ago and I haven’t touched the configuration or the code.

As for the brackets in the code, the example was taken from a tutorial on this web site and I seem to remember having a problem earlier when I didn’t use them, but thanks for note I’ll remember that.

I uninstalled XAMPP and downloaded and installed easyPHP. But easyPHP has the same problem. Everything says it’s working but the PHP code still won’t execute. Then I uninstalled easyPHP and reinstalled XAMPP, but no joy.

So, I’m still stumped. More so since I also had this same XAMPP setup on another XP computer and it’s not working there now either. One thing that has happened to both systems is several updates from Microsoft in the last couple of weeks. I wouldn’t expect that to be the problem, but you never know.

I do have a dual boot system with Ubuntu on it. But I generally find Unix people expect me to know a lot more about it than I do. Is there an all in one PHP/Apache/mSQL installation of Unbuntu? I’m not married to learning PHP on Windows.

Thanks

Figured it out - or rather the Apache help forum figured it out. Somewhere along the line I gave the localhost a userid/password - and I don’t know what it is. Ahh the joys of reinstalling XP from scratch.

If you still want to know about the ubuntu one, Linode Library - Lamp Install Guide is what you want.

thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service