2

I'm trying to run a .php web application on Google Chrome, using Uniform Server. I thought that just having that installed would make PHP run, but clearly there's a lot I don't know. First off, when I opened the file from file:///C:/Users/... etc the PHP didn't execute properly. Here's the code:

<html>
    <body>
        Hello to you, good sir.
        <?php
            echo "</br> Hello there yourself.";
        ?>
    </body>
</html>

Here's the output on the website:

Hello to you, good sir. Hello there yourself."; ?>

And here's how the <body> code looks from Chrome:

Hello to you, good sir.
<!--?php
    echo "</br-->
Hello there yourself.";

Then, when I tried accessing the file from localhost, Chrome wouldn't even connect, saying:

Oops! Google Chrome could not connect to localhost

I'm aware of this question, but the OP didn't appear to have software needed to run PHP. I'm pretty sure I have the right software, but I don't know how to use it. How do I get Uniform Server to run PHP, and how do I connect to localhost from Chrome?

Community
  • 1
  • 1
Lou
  • 1,641
  • 18
  • 52
  • 1
    I'd appreciate it if you didn't mock me; I'm new to PHP, scripting, and server-side scripting. A push in the right direction would be awesome. – Lou Jul 08 '14 at 19:32

1 Answers1

1

PHP wont work if opened directly in browser, thats not how PHP works, it needs to be run through the PHP parser.

A Step by step:

  1. Download the Latest package
  2. Unpack it onto desktop or C:, (somewhere your find it)
  3. Open up the UniServerZ folder, where you unpacked it
  4. Double click UniController.exe
  5. Click Start Apache button - it should go green like below

enter image description here

  1. Remove the junk files in UniServerZ/www
  2. Put your PHP files inside that www folder.
  3. Visit http://localhost to view your PHP files
Lawrence Cherone
  • 41,907
  • 7
  • 51
  • 92
  • Brilliant, one question: which are the junk files? Do I not need the css folder, the images folder, or any of the other files? – Lou Jul 08 '14 at 20:05
  • You dont need any of the files its just the landing page and info for UniServer, what goes in www is your stuff. www is the webroot – Lawrence Cherone Jul 08 '14 at 20:09