Re: Re: Parsing a PHP file - Newbie alert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please keep email responses to the newsgroup / list.  Helps me stay
organized and I help out when I can.

Andrew Hargreaves wrote:
On Tue, 15 Feb 2005 19:20:52 -0500, Jason Barnett
<jason.barnett@xxxxxxxxxxxxx> wrote:
...

When I tried to run my first PHP file to show the PHP Info (<?php
phpinfo(); ?>) the browser, Firefox 1.0 did nothing.

Assuming index.php is in the docroot and it contains the phpinfo() call:

Is this a local server and is the server actually running?  Try browsing
to http://localhost/index.php if this is the case.


I knew I forgot to add something. yes the file is in the htdocs folder
of my apache2 folder on a local server that is running, as confirmed
by checking services.msc

As the file is on my local PC I have been opening it directly (File,
Open File), as opposed to using http://localhost/index.php. Could this
method have caused the problem?

Absolutely! It's a common mistake. If you try to open a PHP file directly then your browser would have no idea to send the script through PHP. But when you browse to that webpage on your local machine (http://localhost/index.php) Apache should do all of that work for you. Assuming of course that Apache is set up properly; if it's not, then tell us what happened when you tried going to this webpage.


I'm at work now but I'll give it a go tonight when I get in and let you know hwo that goes.

Regards

Andrew H

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux