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 #173394 is a reply to message #173385] Thu, 07 April 2011 13:16 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Wed, 06 Apr 2011 20:19:00 -0700, Peter Lauren wrote:

> On Apr 4, 1:19 pm, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote:
>> On Sun, 03 Apr 2011 04:54:02 -0700, Peter Lauren wrote:
>>> I am using Windows XP have installed WAMP and PHP as outlined here
>>> http://www.wampserver.com/en/........ [deleted]
>>
>> Simplified explanation for how php works on a webserver:
>>
>> 1) A surfer users their web browser to send a request to a webserver at
>> "http://<host>/<path>/<file>"
>>
>> ("<file>" is usually somename.php)
>>
>> 2) The webserver at "<host>" determines what file in it's filesystem
>> "<path>/<file>" refers to.
>>
>> 3) The webserver at "<host>" determines that the file in it's
>> filesystem that "<path>/<file>" refers to should be parsed for php code
>> before sending it to the surfers browser.
>>
>> 4) The webserver at "<host>" sends the actual file that "<path>/<file>"
>> refers to to the php script processor, and then sends the output from
>> the php script processor back to the web browser.
>>
>> You need to check that your web server is working. If it's on the same
>> machine as you are developing code on, try using your web browser to
>> connect to:
>>
>> a)http://localhost/
>>
>> or
>>
>> b)http://127.0.0.1/
>>
>> (If it is some other machine, modify the (a) host name or (b) ip
>> address as appropriate)
>>
>> If your web server is working, you should get a default page announcing
>> itself as apache (as you have installed wamp).
>>
>> If you don't get a "welcome to apache webserver" page, then you need to
>> start the webserver. That is beyond the scope of my knowledge, try
>> googling "wamp start webserver process"
>>
>> Once the web server is working, you next need to locate where the
>> webserver root is. This is not the root of your hard disc (or it damn
>> well shouldn't be) and will be specified in a configuration file.
>> Again, google is your friend.
>>
>> In the document root, insert a file called phpinfo.php with the text
>> between the cutlines below:
>>
>> ---8<--- cut here ---8<---
>> <?php phpinfo(); ?>
>> ---8<--- cut here ---8<---
>>
>> Then connect to the following url:
>>
>> http://<(a) server host name or (b) server ip address>/phpinfo.php
>>
>> And if you have been successful, and the web server is running, and
>> your configuration is correct, you will get displayed on your screen a
>> large amount of information about the php and web server configuration.
>>
>> Rgds
>>
>> Denis McMahon
>
> Hi Denis,
>
> On Win XP I went to Start:Run and ran net start wampapache
>
> When I go to http://localhost/, I get a page with the wampserver icon
> and a bunch of stuff including the following.
>
> Server Configuration
>
> Apache Version :
> 2.2.17
> PHP Version :
> 5.3.5
> Loaded Extensions :
>
> * Core
> * bcmath
> * calendar
> [and several other extensions]
>
> MySQL Version :
> 5.5.8
> ---------------------------------------------------------------
>
> The httpd.conf file gives DocumentRoot "c:/wamp/www/"
>
> However when I just have <a href="index.php">PHP</a> on my web page, I
> get a message that it cannot find the file because it is looking in the
> folder that contains the html file. When I use <a
> href="c:/wamp/www/index.php">PHP</a> I get an alert message "Firefox
> doesn't know how to open this address, because the protocol (c) isn't
> associated with any program"
>
> Thanks,
> Peter.


1) If the php file doesn't exist, then of course your web server will
give an error message 404 if it is asked for it.

2) You must use url style addressing in href="" in your web documents,
not operating system based file paths.

3) The file that I suggested you create was:

>> In the document root, insert a file called phpinfo.php with the text
>> between the cutlines below:
>>
>> ---8<--- cut here ---8<---
>> <?php phpinfo(); ?>
>> ---8<--- cut here ---8<---
>>
>> Then connect to the following url:
>>
>> http://<(a) server host name or (b) server ip address>/phpinfo.php

So:

1) create a file in eg notepad that just contains the following as a
single line of text:

<?php phpinfo(); ?>

2) save it in directory "c:\wamp\www\" as filename "phpinfo.php"

3) access it in your web browser as "http://localhost/phpinfo.php"

Now, if you want a file called "index.php" you have to create that file
in the directory "c:\wamp\www" and it should probably contain php script
commands.

Rgds

Denis McMahon
[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 11:29:43 GMT 2024

Total time taken to generate the page: 0.04090 seconds