FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Runs In WinXP Command Window But Not In Browser
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP runs in WinXP command window but not in browser [message #173349 is a reply to message #173341] Mon, 04 April 2011 09:48 Go to previous messageGo to previous message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma:
Senior Member
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 3, 8:39 am, Tim Streater <timstrea...@waitrose.com> wrote:
>> In article
>> <c1edd513-4191-4d35-8325-9da8fd71f...@e21g2000yqe.googlegroups.com>,
>>  Peter Lauren <peterdlau...@gmail.com> wrote:
>>
>>
>>
>>> I am using Windows XP have installed WAMP and PHP as outlined here
>>> http://www.wampserver.com/en/
>>> and have set my search path so that I need only type
>>> php -f PHPExamples.php
>>> and the PHP code runs fine. However, I have not managed to get it to
>>> run in my FireFox/3.5.9 browser. When I make a simple file with the
>>> following contents
>>> <html>
>>> <body>
>>
>>> <?php
>>> $txt1="Hello World!";
>>> $txt2="What a nice day!";
>>
>>> echo $txt1 . " " . $txt2 . " " . strlen("Hello world!") . " " .
>>> strpos("Hello world!","world");
>>> ?>
>>
>>> </body>
>>> </html>
>>
>>> name it Examples.php and call it with a button thus
>>> <a href="Examples.php">PHP</a>
>>
>>> I just get a blank page.
>>
>>> I would be grateful if someone could tell me what I am doing wrong.
>>
>> PHP doesn't run in your browser, or indeed in anyone's browser. You need
>> to be running server software such as apache:
>>
>> +--------------+                                  +----------------+
>> |              |                                  |                |
>> |   Your       |                                  | Web Server     |
>> |  machine     +------- Internet -----------------+ running apache |
>> |   and        |                                  | (your web page |
>> | browser      |                                  | is here too)   |
>> |              |                                  |                |
>> +--------------+                                  +----------------+
>>
>> The web server can be your own machine but this doesn't alter the basic
>> approach.
>>
>> --
>> Tim
>>
>> "That excessive bail ought not to be required, nor excessive fines imposed,
>> nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689
>
> I've been trying to run Apache which I downloaded from http://www.wampserver.com/en/.
> The PHP command works fine in the command Window but I did see a
> thread, on their forum, about Apache not starting. The forum
> moderator said that could be because stuff like zonealarm, and
> firewall/antivirus may cause a conflict. I have them running on my PC
> but I don't want to turn them off and make my PC vulnerable to
> hackers. Should I use a different version of Apache? Should I use
> WAMP at all?
>
> Thanks,
> Peter.

Before you can get PHP to be executed by your local Apache server in
response to a browser request, you have to configure the Apache
server. It sounds like you haven't done that part yet. You might
also have to modify the windows "hosts" file. And be careful not to
make your WAMP/Apache server a security hole that invites the entire
internet world into your PC. alt.apache.configuration is the group to
ask apache configuration questions in, if you decide that's what you
need.

--
no aluminum siding offers today
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: neither var_dump() nor die() displays anything
Next Topic: Spaces in filenames
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 01:15:17 GMT 2024

Total time taken to generate the page: 0.06487 seconds