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
Switch to threaded view of this topic Create a new topic Submit Reply
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173414 is a reply to message #173411] Fri, 08 April 2011 23:45 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 8, 2:01 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>
>
>
>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>  wrote:
>>> Peter Lauren cried from the depths of the abyss...
>
>>>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> part of the task bar.  I do actually get one menu, with the function
>>>> you mention, with a a single click of the left button and a smaller
>>>> menu, with the Exit function, with a single click of the right.  So it
>>>> looks like I'm in business.
>
>>> Fantastic.
>
>> Thanks.  But I'm still having a problem.  I left-click on the task bar
>> icon, click on Apache:httpd.conf, and a file opens in notepad.  In
>> admin. mode, I can edit the file and set
>> DocumentRoot "f:/SomeOther/Directory"
>> It still uses the .php file in c:\wamp\www
>
>> Thanks,
>> Peter.
>
> Did you stop and restart Apache after making the changes?  The
> configuration file is only run when Apache starts up, not on every request.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

I restarted Apache. Now I get

Forbidden

You don't have permission to access /Examples.php on this server.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173415 is a reply to message #173411] Fri, 08 April 2011 23:55 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 8, 2:01 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>
>
>
>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>  wrote:
>>> Peter Lauren cried from the depths of the abyss...
>
>>>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> part of the task bar.  I do actually get one menu, with the function
>>>> you mention, with a a single click of the left button and a smaller
>>>> menu, with the Exit function, with a single click of the right.  So it
>>>> looks like I'm in business.
>
>>> Fantastic.
>
>> Thanks.  But I'm still having a problem.  I left-click on the task bar
>> icon, click on Apache:httpd.conf, and a file opens in notepad.  In
>> admin. mode, I can edit the file and set
>> DocumentRoot "f:/SomeOther/Directory"
>> It still uses the .php file in c:\wamp\www
>
>> Thanks,
>> Peter.
>
> Did you stop and restart Apache after making the changes?  The
> configuration file is only run when Apache starts up, not on every request.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

I fixed the Forbidden problem. There was a part in the httpd.conf
file that said
# This should be changed to whatever you set DocumentRoot to.

I fixed that and now it works.

Still haven't figured out how to get it to work w/o the /localhost/
part though
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173416 is a reply to message #173415] Sat, 09 April 2011 00:02 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 4/8/2011 7:55 PM, Peter Lauren wrote:
> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>
>>
>>
>>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>>>> Peter Lauren cried from the depths of the abyss...
>>
>>>> > I just noticed that I do have the Wampserver icon on the quick launch
>>>> > part of the task bar. I do actually get one menu, with the function
>>>> > you mention, with a a single click of the left button and a smaller
>>>> > menu, with the Exit function, with a single click of the right. So it
>>>> > looks like I'm in business.
>>
>>>> Fantastic.
>>
>>> Thanks. But I'm still having a problem. I left-click on the task bar
>>> icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>> admin. mode, I can edit the file and set
>>> DocumentRoot "f:/SomeOther/Directory"
>>> It still uses the .php file in c:\wamp\www
>>
>>> Thanks,
>>> Peter.
>>
>> Did you stop and restart Apache after making the changes? The
>> configuration file is only run when Apache starts up, not on every request.
>>
>
> I fixed the Forbidden problem. There was a part in the httpd.conf
> file that said
> # This should be changed to whatever you set DocumentRoot to.
>
> I fixed that and now it works.
>
> Still haven't figured out how to get it to work w/o the /localhost/
> part though

Please read what everyone else has been telling you.

YOU CAN'T.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173417 is a reply to message #173415] Sat, 09 April 2011 00:57 Go to previous messageGo to next message
Mr. B-o-B is currently offline  Mr. B-o-B
Messages: 42
Registered: April 2011
Karma: 0
Member
On 4/8/2011 6:55 PM, Peter Lauren wrote:

> I fixed the Forbidden problem. There was a part in the httpd.conf
> file that said
> # This should be changed to whatever you set DocumentRoot to.
>
> I fixed that and now it works.
>
> Still haven't figured out how to get it to work w/o the /localhost/
> part though

What everyone is telling you here is true. You will not be able to drop
the localhost.

What is it you are trying to do exactly? If you want something to run
in your browser w/o a server (aka localhost or whatever) you are in the
wrong group. You will need to look at a client side language like
javascript.

If you are hoping to create a php program that you can just run the only
way I know how to do this is with NUSphere's PHP Dock.

http://www.nusphere.com/products/phpdock.htm

It will take your php code, and make it into a stand alone application.
It's not free, but it might be worth it for you.
I have used this at work, and it's pretty slick.

Otherwise, you will need to use a server to process your php. After
all, it is a server side language.

Enjoy!

Mr. B-o-b
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173418 is a reply to message #173417] Sat, 09 April 2011 02:49 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 4/8/2011 8:57 PM, Mr. B-o-B wrote:
> On 4/8/2011 6:55 PM, Peter Lauren wrote:
>
>> I fixed the Forbidden problem. There was a part in the httpd.conf
>> file that said
>> # This should be changed to whatever you set DocumentRoot to.
>>
>> I fixed that and now it works.
>>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> What everyone is telling you here is true. You will not be able to drop
> the localhost.
>
> What is it you are trying to do exactly? If you want something to run in
> your browser w/o a server (aka localhost or whatever) you are in the
> wrong group. You will need to look at a client side language like
> javascript.
>
> If you are hoping to create a php program that you can just run the only
> way I know how to do this is with NUSphere's PHP Dock.
>
> http://www.nusphere.com/products/phpdock.htm
>
> It will take your php code, and make it into a stand alone application.
> It's not free, but it might be worth it for you.
> I have used this at work, and it's pretty slick.
>
> Otherwise, you will need to use a server to process your php. After all,
> it is a server side language.
>
> Enjoy!
>
> Mr. B-o-b

Not necessarily. It also does well as a scripting language on the
client. But you can't use a browser with it that way.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173420 is a reply to message #173415] Sat, 09 April 2011 08:29 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 8, 2:01 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>
>>
>>
>>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>  wrote:
>>>> Peter Lauren cried from the depths of the abyss...
>>
>>>> > I just noticed that I do have the Wampserver icon on the quick launch
>>>> > part of the task bar.  I do actually get one menu, with the function
>>>> > you mention, with a a single click of the left button and a smaller
>>>> > menu, with the Exit function, with a single click of the right.  So it
>>>> > looks like I'm in business.
>>
>>>> Fantastic.
>>
>>> Thanks.  But I'm still having a problem.  I left-click on the task bar
>>> icon, click on Apache:httpd.conf, and a file opens in notepad.  In
>>> admin. mode, I can edit the file and set
>>> DocumentRoot "f:/SomeOther/Directory"
>>> It still uses the .php file in c:\wamp\www
>>
>>> Thanks,
>>> Peter.
>>
>> Did you stop and restart Apache after making the changes?  The
>> configuration file is only run when Apache starts up, not on every request.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> I fixed the Forbidden problem. There was a part in the httpd.conf
> file that said
> # This should be changed to whatever you set DocumentRoot to.
>
> I fixed that and now it works.
>
> Still haven't figured out how to get it to work w/o the /localhost/
> part though

Depends on what you really want to do. The browser needs a domain to
send your request to, there's no way I know of to avoid giving it
*something*.

Since you're on windows, you can modify your "hosts" file to point
additional domains at ip-addr 127.0.0.1 if you want. Then you'll need
to update "httpd.conf" for those domains too. It gets a bit complex
for me (at least) to attempt to explain here.

If you can be more explicit about what you really want to do, you're
more likely to get an answer you can use.

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173421 is a reply to message #173415] Sat, 09 April 2011 10:26 Go to previous messageGo to next message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma: 0
Senior Member
.oO(Peter Lauren)

> Still haven't figured out how to get it to work w/o the /localhost/
> part though

Not possible. In order to access your websites via HTTP you have to use
a URL, which has to include a hostname. If you don't like 'localhost',
you can add another one, but it has to be at least one char long. So
even then you would have to use a URL like http://x/ to access your
pages. No HTTP request without a hostname.

Micha
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173422 is a reply to message #173421] Sat, 09 April 2011 11:10 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Michael Fesser wrote:
> .oO(Peter Lauren)
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> Not possible. In order to access your websites via HTTP you have to use
> a URL, which has to include a hostname. If you don't like 'localhost',
> you can add another one, but it has to be at least one char long. So
> even then you would have to use a URL like http://x/ to access your
> pages. No HTTP request without a hostname.
>
> Micha
well strictly speaking I suppose you cold say file://

but then its not going via apache, so no PHP interpretation is being
invoked :-)
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173423 is a reply to message #173422] Sat, 09 April 2011 16:09 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <inperp$oak$2(at)news(dot)albasani(dot)net>,
The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

> Michael Fesser wrote:
>> .oO(Peter Lauren)
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> Not possible. In order to access your websites via HTTP you have to use
>> a URL, which has to include a hostname. If you don't like 'localhost',
>> you can add another one, but it has to be at least one char long. So
>> even then you would have to use a URL like http://x/ to access your
>> pages. No HTTP request without a hostname.
>>
>> Micha
> well strictly speaking I suppose you cold say file://
>
> but then its not going via apache, so no PHP interpretation is being
> invoked :-)

Which is what I said way up-thread, but the OP seems to have ignored
that. No PHP (or indeed no server-side scripts of *any* sort, including
form handling).

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173431 is a reply to message #173413] Wed, 13 April 2011 03:06 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 8, 2:30 pm, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote:
> On Fri, 08 Apr 2011 10:53:34 -0700, Peter Lauren wrote:
>> Also, the URL box shows the location as
>> file:///F:/Directory/With/Html/File/Examples.php
>
> You seem to be opening a local php file directly in the web browser. I'm
> sure this has already been discussed in the thread.
>
> 1) Put it somewhere the web server knows about it
> 2) Access it by telling the browser to request it from the web server
> instead of from the filesystem
>
> Rgds
>
> Denis McMahon

That's why I use 'href="http://localhost/file.type"'. I still
confused since using localhost local host works (on my local browser
at least) but nothing else has so far. If the html file making the
call is on my machine, would it not look for the localhost on my
machine?

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173432 is a reply to message #173416] Wed, 13 April 2011 03:07 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 8, 8:02 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 4/8/2011 7:55 PM, Peter Lauren wrote:
>
>
>
>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>
>>>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>    wrote:
>>>> > Peter Lauren cried from the depths of the abyss...
>
>>>> >> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >> part of the task bar.  I do actually get one menu, with the function
>>>> >> you mention, with a a single click of the left button and a smaller
>>>> >> menu, with the Exit function, with a single click of the right.  So it
>>>> >> looks like I'm in business.
>
>>>> > Fantastic.
>
>>>> Thanks.  But I'm still having a problem.  I left-click on the task bar
>>>> icon, click on Apache:httpd.conf, and a file opens in notepad.  In
>>>> admin. mode, I can edit the file and set
>>>> DocumentRoot "f:/SomeOther/Directory"
>>>> It still uses the .php file in c:\wamp\www
>
>>>> Thanks,
>>>> Peter.
>
>>> Did you stop and restart Apache after making the changes?  The
>>> configuration file is only run when Apache starts up, not on every request.
>
>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>> file that said
>> # This should be changed to whatever you set DocumentRoot to.
>
>> I fixed that and now it works.
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> Please read what everyone else has been telling you.
>
> YOU CAN'T.
>
Seems that everyone except Denis is telling me that but Denis seems to
be saying that using localhost will make the code only run on my
machine and not over the Internet. Am I having some sort of mental
block here?

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173433 is a reply to message #173417] Wed, 13 April 2011 03:31 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 8, 8:57 pm, "Mr. B-o-B" <mr.chew.b...@gmail.com> wrote:
> On 4/8/2011 6:55 PM, Peter Lauren wrote:
>
>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>> file that said
>> # This should be changed to whatever you set DocumentRoot to.
>
>> I fixed that and now it works.
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> What everyone is telling you here is true.  You will not be able to drop
> the localhost.
>
> What is it you are trying to do exactly?  If you want something to run
> in your browser w/o a server (aka localhost or whatever) you are in the
> wrong group.  You will need to look at a client side language like
> javascript.
>
> If you are hoping to create a php program that you can just run the only
> way I know how to do this is with NUSphere's PHP Dock.
>
> http://www.nusphere.com/products/phpdock.htm
>
> It will take your php code, and make it into a stand alone application.
>   It's not free, but it might be worth it for you.
> I have used this at work, and it's pretty slick.
>
> Otherwise, you will need to use a server to process your php.  After
> all, it is a server side language.
>
> Enjoy!
>
> Mr. B-o-b

Hi Bob,

I would like to be able to run my code (PHP or Java) on my browser and
over the Internet. I may be misinterpreting Denis but he seems to be
saying that using localhost will make the code only work on the local
machine. That is the source of my confusion.

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173434 is a reply to message #173420] Wed, 13 April 2011 03:33 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 9, 4:29 am, crankypuss <n...@email.thanks> wrote:
> Peter Lauren <peterdlau...@gmail.com> wrote:
>> On Apr 8, 2:01 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>
>>>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>>>> > Peter Lauren cried from the depths of the abyss...
>
>>>> >> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >> part of the task bar. I do actually get one menu, with the function
>>>> >> you mention, with a a single click of the left button and a smaller
>>>> >> menu, with the Exit function, with a single click of the right. So it
>>>> >> looks like I'm in business.
>
>>>> > Fantastic.
>
>>>> Thanks. But I'm still having a problem. I left-click on the task bar
>>>> icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>>> admin. mode, I can edit the file and set
>>>> DocumentRoot "f:/SomeOther/Directory"
>>>> It still uses the .php file in c:\wamp\www
>
>>>> Thanks,
>>>> Peter.
>
>>> Did you stop and restart Apache after making the changes? The
>>> configuration file is only run when Apache starts up, not on every request.
>
>>> --
>>> ==================
>>> Remove the "x" from my email address
>>> Jerry Stuckle
>>> JDS Computer Training Corp.
>>> jstuck...@attglobal.net
>>> ==================
>
>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>> file that said
>> # This should be changed to whatever you set DocumentRoot to.
>
>> I fixed that and now it works.
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> Depends on what you really want to do.  The browser needs a domain to
> send your request to, there's no way I know of to avoid giving it
> *something*.
>
> Since you're on windows, you can modify your "hosts" file to point
> additional domains at ip-addr 127.0.0.1 if you want.  Then you'll need
> to update "httpd.conf" for those domains too.  It gets a bit complex
> for me (at least) to attempt to explain here.
>
> If you can be more explicit about what you really want to do, you're
> more likely to get an answer you can use.
>
> --
> no aluminum siding offers today

I would like to run PHP and Java code on my own browser and over the
Internet. It will be called from an hyml file that is on my local
PC.

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173435 is a reply to message #173421] Wed, 13 April 2011 03:43 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 9, 6:26 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Peter Lauren)
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> Not possible. In order to access your websites via HTTP you have to use
> a URL, which has to include a hostname. If you don't like 'localhost',
> you can add another one, but it has to be at least one char long. So
> even then you would have to use a URL likehttp://x/to access your
> pages. No HTTP request without a hostname.
>
> Micha

Hi Michael,

I have no problem with localhost except that Denis seems to be saying
that it won't work over the Internet. I'm new at this so may be
misinterpreting what he is saying.

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173436 is a reply to message #173421] Wed, 13 April 2011 03:43 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 9, 6:26 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Peter Lauren)
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> Not possible. In order to access your websites via HTTP you have to use
> a URL, which has to include a hostname. If you don't like 'localhost',
> you can add another one, but it has to be at least one char long. So
> even then you would have to use a URL likehttp://x/to access your
> pages. No HTTP request without a hostname.
>
> Micha

Hi Michael,

I have no problem with localhost except that Denis seems to be saying
that it won't work over the Internet. I'm new at this so may be
misinterpreting what he is saying.

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173437 is a reply to message #173421] Wed, 13 April 2011 03:57 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 9, 6:26 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Peter Lauren)
>
>> Still haven't figured out how to get it to work w/o the /localhost/
>> part though
>
> Not possible. In order to access your websites via HTTP you have to use
> a URL, which has to include a hostname. If you don't like 'localhost',
> you can add another one, but it has to be at least one char long. So
> even then you would have to use a URL likehttp://x/to access your
> pages. No HTTP request without a hostname.
>
> Micha

Hi Michael,

I have no problem with localhost except that Denis seems to be saying
that it won't work over the Internet. I'm new at this so may be
misinterpreting what he is saying.

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173439 is a reply to message #173432] Wed, 13 April 2011 09:23 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 4/12/2011 11:07 PM, Peter Lauren wrote:
> On Apr 8, 8:02 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 4/8/2011 7:55 PM, Peter Lauren wrote:
>>
>>
>>
>>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>>>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>
>>>> > On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>>>> >> Peter Lauren cried from the depths of the abyss...
>>
>>>> >>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>> part of the task bar. I do actually get one menu, with the function
>>>> >>> you mention, with a a single click of the left button and a smaller
>>>> >>> menu, with the Exit function, with a single click of the right. So it
>>>> >>> looks like I'm in business.
>>
>>>> >> Fantastic.
>>
>>>> > Thanks. But I'm still having a problem. I left-click on the task bar
>>>> > icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>>> > admin. mode, I can edit the file and set
>>>> > DocumentRoot "f:/SomeOther/Directory"
>>>> > It still uses the .php file in c:\wamp\www
>>
>>>> > Thanks,
>>>> > Peter.
>>
>>>> Did you stop and restart Apache after making the changes? The
>>>> configuration file is only run when Apache starts up, not on every request.
>>
>>> I fixed the Forbidden problem. There was a part in the httpd.conf
>>> file that said
>>> # This should be changed to whatever you set DocumentRoot to.
>>
>>> I fixed that and now it works.
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> Please read what everyone else has been telling you.
>>
>> YOU CAN'T.
>>
> Seems that everyone except Denis is telling me that but Denis seems to
> be saying that using localhost will make the code only run on my
> machine and not over the Internet. Am I having some sort of mental
> block here?
>
> Thanks,
> Peter.
>

Localhost is running tcp/ip - it's just running it on your machine.

You asked "how to get it to work w/o the /localhost/ part though". The
answer is - YOU CAN'T. You MUST have a webserver running, and you MUST
access the web server from your browser - whether it is localhost or
example.com or whatever.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173440 is a reply to message #173434] Wed, 13 April 2011 09:25 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 4/12/2011 11:33 PM, Peter Lauren wrote:
> On Apr 9, 4:29 am, crankypuss<n...@email.thanks> wrote:
>> Peter Lauren<peterdlau...@gmail.com> wrote:
>>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>>>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>
>>>> > On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>>>> >> Peter Lauren cried from the depths of the abyss...
>>
>>>> >>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>> part of the task bar. I do actually get one menu, with the function
>>>> >>> you mention, with a a single click of the left button and a smaller
>>>> >>> menu, with the Exit function, with a single click of the right. So it
>>>> >>> looks like I'm in business.
>>
>>>> >> Fantastic.
>>
>>>> > Thanks. But I'm still having a problem. I left-click on the task bar
>>>> > icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>>> > admin. mode, I can edit the file and set
>>>> > DocumentRoot "f:/SomeOther/Directory"
>>>> > It still uses the .php file in c:\wamp\www
>>
>>>> > Thanks,
>>>> > Peter.
>>
>>>> Did you stop and restart Apache after making the changes? The
>>>> configuration file is only run when Apache starts up, not on every request.
>>
>>>> --
>>>> ==================
>>>> Remove the "x" from my email address
>>>> Jerry Stuckle
>>>> JDS Computer Training Corp.
>>>> jstuck...@attglobal.net
>>>> ==================
>>
>>> I fixed the Forbidden problem. There was a part in the httpd.conf
>>> file that said
>>> # This should be changed to whatever you set DocumentRoot to.
>>
>>> I fixed that and now it works.
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> Depends on what you really want to do. The browser needs a domain to
>> send your request to, there's no way I know of to avoid giving it
>> *something*.
>>
>> Since you're on windows, you can modify your "hosts" file to point
>> additional domains at ip-addr 127.0.0.1 if you want. Then you'll need
>> to update "httpd.conf" for those domains too. It gets a bit complex
>> for me (at least) to attempt to explain here.
>>
>> If you can be more explicit about what you really want to do, you're
>> more likely to get an answer you can use.
>>
>> --
>> no aluminum siding offers today
>
> I would like to run PHP and Java code on my own browser and over the
> Internet. It will be called from an hyml file that is on my local
> PC.
>
> Thanks,
> Peter.

Browsers don't run PHP or Java code (they can, however, run Javascript
code, which is an entirely different animal).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173442 is a reply to message #173432] Wed, 13 April 2011 10:46 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 8, 8:02 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> On 4/8/2011 7:55 PM, Peter Lauren wrote:
>>
>>
>>
>>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>>>> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>
>>>> > On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>    wrote:
>>>> >> Peter Lauren cried from the depths of the abyss...
>>
>>>> >>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>> part of the task bar.  I do actually get one menu, with the function
>>>> >>> you mention, with a a single click of the left button and a smaller
>>>> >>> menu, with the Exit function, with a single click of the right.  So it
>>>> >>> looks like I'm in business.
>>
>>>> >> Fantastic.
>>
>>>> > Thanks.  But I'm still having a problem.  I left-click on the task bar
>>>> > icon, click on Apache:httpd.conf, and a file opens in notepad.  In
>>>> > admin. mode, I can edit the file and set
>>>> > DocumentRoot "f:/SomeOther/Directory"
>>>> > It still uses the .php file in c:\wamp\www
>>
>>>> > Thanks,
>>>> > Peter.
>>
>>>> Did you stop and restart Apache after making the changes?  The
>>>> configuration file is only run when Apache starts up, not on every request.
>>
>>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>>> file that said
>>> # This should be changed to whatever you set DocumentRoot to.
>>
>>> I fixed that and now it works.
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> Please read what everyone else has been telling you.
>>
>> YOU CAN'T.
>>
> Seems that everyone except Denis is telling me that but Denis seems to
> be saying that using localhost will make the code only run on my
> machine and not over the Internet. Am I having some sort of mental
> block here?

Sounds that way to me.

The PHP code you are running on an apache server (via wampserver in
your case) has to receive http messages that describe a client
request. The incoming http messages are what kicks it off---apache
just sits there listening until it receives a message that is "aimed"
at your domain; when it receives an http request it runs your PHP code
and it generates the response message in the form of an html page (or
whatever it happens to generate, could be a download file for
example).

You can send the http requests to your server (that is running your
PHP code) through basically anything that can establish a connection
to it, for example another server could do it with a socket connection
to your server's port-80. But what most "users" use to send the
requests is a browser. A browser is mostly rendering engine, most of
its code revolves around displaying the response messages your (or
whatever) server generates.

In order to tell the browser where to send the http requests that kick
the process off, it has to know which of umptyzillion servers on the
net to send the message to. You tell it this by typing the server's
address in the location bar.

Since your server is running as "http:/localhost/" you need to type
that in or your browser won't send the request to your server. If you
set up your server to run as "http:/z/ (for example) then that's what
you'd need to type in, and you would do that setup within apache's
configuration file http.conf and you would define the domain "z" using
the windows "hosts" file. Or you could use "http://127.0.0.1/" which
amounts to the same thing but doesn't use symbolic notation.

I'm not a javascript guy, but you *might* be able to run some
front-end javascript application on your browser that would supply the
domain name without your having to type it. I understand that the
Opera browser offers a lot more customization capability than most so
you might want to look at it once you get things running. For that
matter you could download the source code for FireFox (I think it's
available) and modify it to create your own browser.

It isn't magic, it's a matter of grasping the context in which your
PHP code is running. Your "mental block" seems to be that you want
the browser to know what server you mean, without telling it.

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173443 is a reply to message #173433] Wed, 13 April 2011 10:58 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 8, 8:57 pm, "Mr. B-o-B" <mr.chew.b...@gmail.com> wrote:
>> On 4/8/2011 6:55 PM, Peter Lauren wrote:
>>
>>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>>> file that said
>>> # This should be changed to whatever you set DocumentRoot to.
>>
>>> I fixed that and now it works.
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> What everyone is telling you here is true.  You will not be able to drop
>> the localhost.
>>
>> What is it you are trying to do exactly?  If you want something to run
>> in your browser w/o a server (aka localhost or whatever) you are in the
>> wrong group.  You will need to look at a client side language like
>> javascript.
>>
>> If you are hoping to create a php program that you can just run the only
>> way I know how to do this is with NUSphere's PHP Dock.
>>
>> http://www.nusphere.com/products/phpdock.htm
>>
>> It will take your php code, and make it into a stand alone application.
>>   It's not free, but it might be worth it for you.
>> I have used this at work, and it's pretty slick.
>>
>> Otherwise, you will need to use a server to process your php.  After
>> all, it is a server side language.
>>
>> Enjoy!
>>
>> Mr. B-o-b
>
> Hi Bob,
>
> I would like to be able to run my code (PHP or Java) on my browser and
> over the Internet. I may be misinterpreting Denis but he seems to be
> saying that using localhost will make the code only work on the local
> machine. That is the source of my confusion.

Your code only exists on your local machine. From the same machine
you can address it as localhost because that is a fixed name that is
known to mean "this machine", ie 127.0.0.1 Your server could ALSO be
accessed from elsewhere on the internet (if wampserver is "online"),
but the user would need to know the ip-address to send requests to.
How that works is basically that a DNS (Distributed Name Server as I
recall, though it's been a while and I'm fuzzy on whether the "D" is
for "Distributed") which takes a symbolic name and returns an
ip-address of the form a.b.c.d (don't ask *me* about ipv6 addressing
this week, or even the inmost details of ipv4 addressing, please).

To set up a (socket or other) connection between the user's
application (in this case the browser) and the server which runs the
PHP code, an ip-address is absolutely required. The ip-address
consists of numbers that completely locate the server node within the
network. Symbolic names are converted to numeric ip-addresses by name
servers (DNS). If the client and server are on the same machine they
can use 127.0.0.1 or "localhost" which is a convention set up to avoid
a firm requirement for the involvement of a DNS.

The whole thing is analogous to making a phone call. If you want to
call a server you have to have its number. The localhost convention
is analogous to dialing 911 in that it says 127.0.0.1 defines the
local server. Aside from that you have to know the phone number you
want, or look it up in the directory (DNS).

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173444 is a reply to message #173440] Wed, 13 April 2011 11:00 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:

> On 4/12/2011 11:33 PM, Peter Lauren wrote:
>> On Apr 9, 4:29 am, crankypuss<n...@email.thanks> wrote:
>>> Peter Lauren<peterdlau...@gmail.com> wrote:
>>>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>>>> > On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>>
>>>> >> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>>>> >>> Peter Lauren cried from the depths of the abyss...
>>>
>>>> >>>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>>> part of the task bar. I do actually get one menu, with the function
>>>> >>>> you mention, with a a single click of the left button and a smaller
>>>> >>>> menu, with the Exit function, with a single click of the right. So it
>>>> >>>> looks like I'm in business.
>>>
>>>> >>> Fantastic.
>>>
>>>> >> Thanks. But I'm still having a problem. I left-click on the task bar
>>>> >> icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>>> >> admin. mode, I can edit the file and set
>>>> >> DocumentRoot "f:/SomeOther/Directory"
>>>> >> It still uses the .php file in c:\wamp\www
>>>
>>>> >> Thanks,
>>>> >> Peter.
>>>
>>>> > Did you stop and restart Apache after making the changes? The
>>>> > configuration file is only run when Apache starts up, not on every request.
>>>
>>>> > --
>>>> > ==================
>>>> > Remove the "x" from my email address
>>>> > Jerry Stuckle
>>>> > JDS Computer Training Corp.
>>>> > jstuck...@attglobal.net
>>>> > ==================
>>>
>>>> I fixed the Forbidden problem. There was a part in the httpd.conf
>>>> file that said
>>>> # This should be changed to whatever you set DocumentRoot to.
>>>
>>>> I fixed that and now it works.
>>>
>>>> Still haven't figured out how to get it to work w/o the /localhost/
>>>> part though
>>>
>>> Depends on what you really want to do. The browser needs a domain to
>>> send your request to, there's no way I know of to avoid giving it
>>> *something*.
>>>
>>> Since you're on windows, you can modify your "hosts" file to point
>>> additional domains at ip-addr 127.0.0.1 if you want. Then you'll need
>>> to update "httpd.conf" for those domains too. It gets a bit complex
>>> for me (at least) to attempt to explain here.
>>>
>>> If you can be more explicit about what you really want to do, you're
>>> more likely to get an answer you can use.
>>>
>>> --
>>> no aluminum siding offers today
>>
>> I would like to run PHP and Java code on my own browser and over the
>> Internet. It will be called from an hyml file that is on my local
>> PC.
>>
>> Thanks,
>> Peter.
>
> Browsers don't run PHP or Java code (they can, however, run Javascript
> code, which is an entirely different animal).

Seems like Peter is missing a bit of context. Maybe someone knows of
a site that has a good diagram of the client/server relationship.

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173445 is a reply to message #173436] Wed, 13 April 2011 11:08 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 9, 6:26 am, Michael Fesser <neti...@gmx.de> wrote:
>> .oO(Peter Lauren)
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> Not possible. In order to access your websites via HTTP you have to use
>> a URL, which has to include a hostname. If you don't like 'localhost',
>> you can add another one, but it has to be at least one char long. So
>> even then you would have to use a URL likehttp://x/to access your
>> pages. No HTTP request without a hostname.
>>
>> Micha
>
> Hi Michael,
>
> I have no problem with localhost except that Denis seems to be saying
> that it won't work over the Internet. I'm new at this so may be
> misinterpreting what he is saying.

This is usenet and you are talking to a bunch of freaking programmers
who tend to take things literally and answer only the specific
question asked.

Yes, localhost never works across the network.
Yes, your server can work across the network.

When your server works across the internet it's never accessed as
"localhost" though. "localhost" is a convention that always means
"this machine" so any user asking for localhost will get *his*
localhost, not yours. For your server to be accessed from other than
your machine, the user's browser needs to know its ip-address, which
can be looked up in his local directory (DNS, name-server). Or he can
access it by using a fixed ip-address but it won't be 127.0.0.1

localhost is a convention, a nickname for "this machine". Everybody
pretty much has one and they're all different.

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173446 is a reply to message #173431] Wed, 13 April 2011 11:11 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 8, 2:30 pm, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote:
>> On Fri, 08 Apr 2011 10:53:34 -0700, Peter Lauren wrote:
>>> Also, the URL box shows the location as
>>> file:///F:/Directory/With/Html/File/Examples.php
>>
>> You seem to be opening a local php file directly in the web browser. I'm
>> sure this has already been discussed in the thread.
>>
>> 1) Put it somewhere the web server knows about it
>> 2) Access it by telling the browser to request it from the web server
>> instead of from the filesystem
>>
>> Rgds
>>
>> Denis McMahon
>
> That's why I use 'href="http://localhost/file.type"'. I still
> confused since using localhost local host works (on my local browser
> at least) but nothing else has so far. If the html file making the
> call is on my machine, would it not look for the localhost on my
> machine?

html files don't make calls. html files contain URLs that can be used
as links. The browser makes the call when you click on a link.

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173448 is a reply to message #173437] Wed, 13 April 2011 12:20 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<dcfaef3a-c83d-47e0-8988-bc3a40b2f572(at)p16g2000vbi(dot)googlegroups(dot)com>,
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 9, 6:26
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173449 is a reply to message #173433] Wed, 13 April 2011 12:23 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<15fc9507-6444-4b07-bce5-111a277234f9(at)f11g2000vbx(dot)googlegroups(dot)com>,
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 8, 8:57
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173450 is a reply to message #173431] Wed, 13 April 2011 12:25 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<b0e7a54a-561e-465b-8579-270e1d81276a(at)gu8g2000vbb(dot)googlegroups(dot)com>,
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> On Apr 8, 2:30
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173451 is a reply to message #173433] Wed, 13 April 2011 12:29 Go to previous messageGo to next message
Mr. B-o-B is currently offline  Mr. B-o-B
Messages: 42
Registered: April 2011
Karma: 0
Member
On 4/12/2011 10:31 PM, Peter Lauren wrote:
> On Apr 8, 8:57 pm, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>> On 4/8/2011 6:55 PM, Peter Lauren wrote:
>>
>>> I fixed the Forbidden problem. There was a part in the httpd.conf
>>> file that said
>>> # This should be changed to whatever you set DocumentRoot to.
>>
>>> I fixed that and now it works.
>>
>>> Still haven't figured out how to get it to work w/o the /localhost/
>>> part though
>>
>> What everyone is telling you here is true. You will not be able to drop
>> the localhost.
>>
>> What is it you are trying to do exactly? If you want something to run
>> in your browser w/o a server (aka localhost or whatever) you are in the
>> wrong group. You will need to look at a client side language like
>> javascript.
>>
>> If you are hoping to create a php program that you can just run the only
>> way I know how to do this is with NUSphere's PHP Dock.
>>
>> http://www.nusphere.com/products/phpdock.htm
>>
>> It will take your php code, and make it into a stand alone application.
>> It's not free, but it might be worth it for you.
>> I have used this at work, and it's pretty slick.
>>
>> Otherwise, you will need to use a server to process your php. After
>> all, it is a server side language.
>>
>> Enjoy!
>>
>> Mr. B-o-b
>
> Hi Bob,
>
> I would like to be able to run my code (PHP or Java) on my browser and
> over the Internet. I may be misinterpreting Denis but he seems to be
> saying that using localhost will make the code only work on the local
> machine. That is the source of my confusion.
>
> Thanks,
> Peter.

localhost will resolve to whatever machine you are one. If you are
typing localhost on the machine with the webserver/php then you will
reach the webserver/web files. If you go to another machine & type
localhost it will resolve to the machine you are typing this on, and not
your webserver (page not found).

If you want to access your webserver from another machine, you need to
use the IP # of your webserver box. You will need a public IP for
internet use, and if your IP is static you can register a domain name &
setup a dns server, or use one of the many free dns servers available to
resolve your domain name to the ip. Then on the internet if someone
types www.yourdomainname.com then it will resolve to your IP & find the
sevrer.

This is an extremely generic example, but in a nutshell is how it works.
If this blows your mind, you might want to take a step back & do a
little networking 101 reading to help you on your quest.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173452 is a reply to message #173444] Wed, 13 April 2011 12:43 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <tf0bq656k78ct2k9r5ohhd565ka6btsujt(at)4ax(dot)com>,
crankypuss <no(at)email(dot)thanks> wrote:

> Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:
>
>> On 12/4/2011 11:33 PM, Peter Lauren wrote:

>>> I would like to run PHP and Java code on my own browser and over the
>>> Internet. It will be called from an hyml file that is on my local
>>> PC.
>>>
>>> Thanks,
>>> Peter.
>>
>> Browsers don't run PHP or Java code (they can, however, run Javascript
>> code, which is an entirely different animal).
>
> Seems like Peter is missing a bit of context. Maybe someone knows of
> a site that has a good diagram of the client/server relationship.

I did an ascii-art diagram of two machines showing which bit of software
sits on which machine, way upthread. The OP has not, to my knowledge
said whether he saw it or whether it helped or not, and if not why not.

In this business, as in any other, you have to learn how to ask
questions intelligently. This can be hard if you're thoroughly confused.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173453 is a reply to message #173452] Wed, 13 April 2011 14:17 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
Tim Streater <timstreater(at)waitrose(dot)com> wrote:

> In article <tf0bq656k78ct2k9r5ohhd565ka6btsujt(at)4ax(dot)com>,
> crankypuss <no(at)email(dot)thanks> wrote:
>
>> Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:
>>
>>> On 12/4/2011 11:33 PM, Peter Lauren wrote:
>
>>>> I would like to run PHP and Java code on my own browser and over the
>>>> Internet. It will be called from an hyml file that is on my local
>>>> PC.
>>>>
>>>> Thanks,
>>>> Peter.
>>>
>>> Browsers don't run PHP or Java code (they can, however, run Javascript
>>> code, which is an entirely different animal).
>>
>> Seems like Peter is missing a bit of context. Maybe someone knows of
>> a site that has a good diagram of the client/server relationship.
>
> I did an ascii-art diagram of two machines showing which bit of software
> sits on which machine, way upthread. The OP has not, to my knowledge
> said whether he saw it or whether it helped or not, and if not why not.

I noticed it, whether he did or not, but there ought to be something
on the web that shows a similar diagram with more details.

> In this business, as in any other, you have to learn how to ask
> questions intelligently. This can be hard if you're thoroughly confused.

No kidding. Sometimes it's better to ask questions stupidly rather
than intelligently though, that at least seems to prevent asking the
wrong questions. <g>

--
no aluminum siding offers today
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173454 is a reply to message #173374] Wed, 13 April 2011 16:14 Go to previous messageGo to next message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma: 0
Member
On 4/5/2011 2:36 PM, Jim Higgins wrote:
> Denis, the above is good stuff - THANK YOU - but how does one
> configure so that simply clicking on that phpinfo.php file results in
> the same action as connecting to
> http://localhost/phpinfo.php
>
> The answer to that would make life so much simpler. Having to type
> "http://localhost/" before every file name while trying to develop
> something is a total pain in the butt.

There are two things you can do to "make life so much simpler", both are
beyond the scope of this forum. However, they are:

1) set up an IDE to run your php script/file as you edit i.e. PSPad
w/appropriate compiler settings to execute PHP.

and

2) establish virtual host(s) in your host file and httpd.conf or
httpd-vhosts.conf. the vhost (ServerName) can be any name you like such
as "dev" or "dev1." If you really want to "make life so much simpler"
set DirectoryIndex to the name of your file, or simply name your file
index.php while testing. Then all you have to type into the browser is
"dev" (you don't even need the "http://" because the browser will assume
that for you.

However, like I said. Further details should be sought in Apache and
PSPad documentation.

BTW I stopped using wamp configurations on my Win boxes in favor of
individual installation of each component (Apache, PHP, MySql, etc.)
because it gave me greater control over my environment, and updates. It
requires a little more effort up front, but helps to insure you know
what's what, and pays off in many ways.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173455 is a reply to message #173431] Wed, 13 April 2011 17:46 Go to previous messageGo to next message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma: 0
Member
On 4/12/2011 11:06 PM, Peter Lauren wrote:
> That's why I use 'href="http://localhost/file.type"'. I still
> confused since using localhost local host works (on my local browser
> at least) but nothing else has so far. If the html file making the
> call is on my machine, would it not look for the localhost on my
> machine?

Peter,

You seem to be in information overload, and confusing what you know,
what you think you know, and what you don't know you don't know. Step
back and look at some of the individual pieces.

First research the difference between "file://" protocol and "http://"
protocol. hint: one is telling the browser to look directly in the file
system (bypassing the server). The other says "ask the server for a
resource."

Second study how the server translates a url request (received on the
network) to the file system location of that resource.

Then look up the different reference schemes (i.e. relative v absolute)
and that may help you see how href="http://localhost/file.type" can be
"abbreviated" to href="/file.type" or even href="file.type" in some
occasions.

copy the following and save it as index.php in the folder indicated by
the DocumentRoot directive of your httpd.conf file. Enter "localhost" in
your browser and it will help you begin to feel your way around.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="generator" content="GCGroup, LLC - www.gcgroup.net">
<link rel="shortcut icon" href="/favicon.ico" />
<title>FIND ME</title>
</head>
<body>
Hello <?php echo $_SERVER['REMOTE_ADDR'];?><br>
<p>You are here!<br>
Document Root: <?php echo $_SERVER['DOCUMENT_ROOT'];?><br>
System path:<?php echo $_SERVER['SCRIPT_FILENAME' ]; ?>
</body>
</html>
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173456 is a reply to message #173439] Wed, 13 April 2011 17:59 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 13, 5:23 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 4/12/2011 11:07 PM, Peter Lauren wrote:
>
>
>
>> On Apr 8, 8:02 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>>> On 4/8/2011 7:55 PM, Peter Lauren wrote:
>
>>>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
>>>> > On 4/8/2011 1:45 PM, Peter Lauren wrote:
>
>>>> >> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>      wrote:
>>>> >>> Peter Lauren cried from the depths of the abyss...
>
>>>> >>>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>>> part of the task bar.  I do actually get one menu, with the function
>>>> >>>> you mention, with a a single click of the left button and a smaller
>>>> >>>> menu, with the Exit function, with a single click of the right.  So it
>>>> >>>> looks like I'm in business.
>
>>>> >>> Fantastic.
>
>>>> >> Thanks.  But I'm still having a problem.  I left-click on the task bar
>>>> >> icon, click on Apache:httpd.conf, and a file opens in notepad.  In
>>>> >> admin. mode, I can edit the file and set
>>>> >> DocumentRoot "f:/SomeOther/Directory"
>>>> >> It still uses the .php file in c:\wamp\www
>
>>>> >> Thanks,
>>>> >> Peter.
>
>>>> > Did you stop and restart Apache after making the changes?  The
>>>> > configuration file is only run when Apache starts up, not on every request.
>
>>>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>>>> file that said
>>>> # This should be changed to whatever you set DocumentRoot to.
>
>>>> I fixed that and now it works.
>
>>>> Still haven't figured out how to get it to work w/o the /localhost/
>>>> part though
>
>>> Please read what everyone else has been telling you.
>
>>> YOU CAN'T.
>
>> Seems that everyone except Denis is telling me that but Denis seems to
>> be saying that using localhost will make the code only run on my
>> machine and not over the Internet.  Am I having some sort of mental
>> block here?
>
>> Thanks,
>> Peter.
>
> Localhost is running tcp/ip - it's just running it on your machine.
>
> You asked "how to get it to work w/o the /localhost/ part though".  The
> answer is - YOU CAN'T. You MUST have a webserver running, and you MUST
> access the web server from your browser - whether it is localhost or
> example.com or whatever.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Hi Jerry,

Thanks for your reply. I have WAMP set up and running on my PC. I
couldn't get the output of the PHP code to display on my browser
before I did that but now it shows up when I call <a href="http:/
localhost/Examples.php">PHP</a>. You it appears that I have a web
server running and am accessing it from my browser. I'm glad I can
see the output on the FF browser of my PC but I would like it to be
seen across the Internet as well. What changes would I need to make
to do that?

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173457 is a reply to message #173440] Wed, 13 April 2011 18:16 Go to previous messageGo to next message
Peter Lauren is currently offline  Peter Lauren
Messages: 48
Registered: April 2011
Karma: 0
Member
On Apr 13, 5:25 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 4/12/2011 11:33 PM, Peter Lauren wrote:
>
>
>
>> On Apr 9, 4:29 am, crankypuss<n...@email.thanks>  wrote:
>>> Peter Lauren<peterdlau...@gmail.com>  wrote:
>>>> On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>>>> > On 4/8/2011 1:45 PM, Peter Lauren wrote:
>
>>>> >> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com>  wrote:
>>>> >>> Peter Lauren cried from the depths of the abyss...
>
>>>> >>>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>>> part of the task bar. I do actually get one menu, with the function
>>>> >>>> you mention, with a a single click of the left button and a smaller
>>>> >>>> menu, with the Exit function, with a single click of the right. So it
>>>> >>>> looks like I'm in business.
>
>>>> >>> Fantastic.
>
>>>> >> Thanks. But I'm still having a problem. I left-click on the task bar
>>>> >> icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>>> >> admin. mode, I can edit the file and set
>>>> >> DocumentRoot "f:/SomeOther/Directory"
>>>> >> It still uses the .php file in c:\wamp\www
>
>>>> >> Thanks,
>>>> >> Peter.
>
>>>> > Did you stop and restart Apache after making the changes? The
>>>> > configuration file is only run when Apache starts up, not on every request.
>
>>>> > --
>>>> > ==================
>>>> > Remove the "x" from my email address
>>>> > Jerry Stuckle
>>>> > JDS Computer Training Corp.
>>>> > jstuck...@attglobal.net
>>>> > ==================
>
>>>> I fixed the Forbidden problem.  There was a part in the httpd.conf
>>>> file that said
>>>> # This should be changed to whatever you set DocumentRoot to.
>
>>>> I fixed that and now it works.
>
>>>> Still haven't figured out how to get it to work w/o the /localhost/
>>>> part though
>
>>> Depends on what you really want to do.  The browser needs a domain to
>>> send your request to, there's no way I know of to avoid giving it
>>> *something*.
>
>>> Since you're on windows, you can modify your "hosts" file to point
>>> additional domains at ip-addr 127.0.0.1 if you want.  Then you'll need
>>> to update "httpd.conf" for those domains too.  It gets a bit complex
>>> for me (at least) to attempt to explain here.
>
>>> If you can be more explicit about what you really want to do, you're
>>> more likely to get an answer you can use.
>
>>> --
>>> no aluminum siding offers today
>
>> I would like to run PHP and Java code on my own browser and over the
>> Internet.   It will be called from an hyml file that is on my local
>> PC.
>
>> Thanks,
>> Peter.
>
> Browsers don't run PHP or Java code (they can, however, run Javascript
> code, which is an entirely different animal).
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

I learned JavaScript before this and did not need a browser as you
point out. It was when I started using PHP that I found I could not
see the output on my browser until I installed WAMP and started it
running. Now I can see the output when WAMP is running so the browser
would appear to be accessing the server. The server is currently
offline but I still get the output on my browser.

Thanks,
Peter.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173459 is a reply to message #173456] Wed, 13 April 2011 18:33 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<bf957449-af4e-4557-ad7d-0df18673fb1c(at)m7g2000vbq(dot)googlegroups(dot)com>,
Peter Lauren <peterdlauren(at)gmail(dot)com> wrote:

> I have WAMP set up and running on my PC. I
> couldn't get the output of the PHP code to display on my browser
> before I did that but now it shows up when I call <a href="http:/
> localhost/Examples.php">PHP</a>. You it appears that I have a web
> server running and am accessing it from my browser. I'm glad I can
> see the output on the FF browser of my PC but I would like it to be
> seen across the Internet as well. What changes would I need to make
> to do that?

Peter,

You're being unclear as to what you want to do. Which of the following
is it? You have some web pages you're accessing locally on your own
computer by using the computer host name localhost. Now:

1) Do you now want to move your web pages to a distant computer and
still access them from your own computer?

2) You want to *leave* the web pages on your *own* computer, but remove
*yourself* to a distant computer and access them from there?

These are different questions requiring different answers. I don't know
which one you mean.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173460 is a reply to message #173456] Wed, 13 April 2011 18:36 Go to previous messageGo to next message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma: 0
Senior Member
.oO(Peter Lauren)

> Thanks for your reply. I have WAMP set up and running on my PC. I
> couldn't get the output of the PHP code to display on my browser
> before I did that but now it shows up when I call <a href="http:/
> localhost/Examples.php">PHP</a>.

Good.

> You it appears that I have a web
> server running and am accessing it from my browser. I'm glad I can
> see the output on the FF browser of my PC but I would like it to be
> seen across the Internet as well. What changes would I need to make
> to do that?

As a beginner you definitely don't want to host a public site on your
own machine! You would have to

* spend a lot of thoughts about how to secure the machine
* think about and implement a firewall concept
* get a fast connection (a DSL uplink is not fast)
* get a dynamic DNS name
* keep the machine running 24/7
* …

Additionally, if you don't want to become a part of a botnet:

* follow security mailinglists
* keep the used software as up-to-date as possible
* …

The Internet is no playground. If you're not exactly sure about what
you're doing, don't connect your own server to the Net! It will be an
invitation for hackers and a huge security risk for yourself and others.

Instead get some cheap hosting package and upload your page to their
properly maintained server. It will be faster, more reliable and - most
important - much more secure.

If you just want to show your site to some of your friends every now and
then, you might want to have a look at VNC or TeamViewer. But if it's
intended to be public and available 24/7, get a hosting package.

Micha
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173462 is a reply to message #173457] Wed, 13 April 2011 19:12 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 4/13/2011 2:16 PM, Peter Lauren wrote:
> On Apr 13, 5:25 am, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>> On 4/12/2011 11:33 PM, Peter Lauren wrote:
>>
>>
>>
>>> On Apr 9, 4:29 am, crankypuss<n...@email.thanks> wrote:
>>>> Peter Lauren<peterdlau...@gmail.com> wrote:
>>>> > On Apr 8, 2:01 pm, Jerry Stuckle<jstuck...@attglobal.net> wrote:
>>>> >> On 4/8/2011 1:45 PM, Peter Lauren wrote:
>>
>>>> >>> On Apr 8, 8:04 am, "Mr. B-o-B"<mr.chew.b...@gmail.com> wrote:
>>>> >>>> Peter Lauren cried from the depths of the abyss...
>>
>>>> >>>>> I just noticed that I do have the Wampserver icon on the quick launch
>>>> >>>>> part of the task bar. I do actually get one menu, with the function
>>>> >>>>> you mention, with a a single click of the left button and a smaller
>>>> >>>>> menu, with the Exit function, with a single click of the right. So it
>>>> >>>>> looks like I'm in business.
>>
>>>> >>>> Fantastic.
>>
>>>> >>> Thanks. But I'm still having a problem. I left-click on the task bar
>>>> >>> icon, click on Apache:httpd.conf, and a file opens in notepad. In
>>>> >>> admin. mode, I can edit the file and set
>>>> >>> DocumentRoot "f:/SomeOther/Directory"
>>>> >>> It still uses the .php file in c:\wamp\www
>>
>>>> >>> Thanks,
>>>> >>> Peter.
>>
>>>> >> Did you stop and restart Apache after making the changes? The
>>>> >> configuration file is only run when Apache starts up, not on every request.
>>
>>>> >> --
>>>> >> ==================
>>>> >> Remove the "x" from my email address
>>>> >> Jerry Stuckle
>>>> >> JDS Computer Training Corp.
>>>> >> jstuck...@attglobal.net
>>>> >> ==================
>>
>>>> > I fixed the Forbidden problem. There was a part in the httpd.conf
>>>> > file that said
>>>> > # This should be changed to whatever you set DocumentRoot to.
>>
>>>> > I fixed that and now it works.
>>
>>>> > Still haven't figured out how to get it to work w/o the /localhost/
>>>> > part though
>>
>>>> Depends on what you really want to do. The browser needs a domain to
>>>> send your request to, there's no way I know of to avoid giving it
>>>> *something*.
>>
>>>> Since you're on windows, you can modify your "hosts" file to point
>>>> additional domains at ip-addr 127.0.0.1 if you want. Then you'll need
>>>> to update "httpd.conf" for those domains too. It gets a bit complex
>>>> for me (at least) to attempt to explain here.
>>
>>>> If you can be more explicit about what you really want to do, you're
>>>> more likely to get an answer you can use.
>>
>>>> --
>>>> no aluminum siding offers today
>>
>>> I would like to run PHP and Java code on my own browser and over the
>>> Internet. It will be called from an hyml file that is on my local
>>> PC.
>>
>>> Thanks,
>>> Peter.
>>
>> Browsers don't run PHP or Java code (they can, however, run Javascript
>> code, which is an entirely different animal).
>>
>
> I learned JavaScript before this and did not need a browser as you
> point out. It was when I started using PHP that I found I could not
> see the output on my browser until I installed WAMP and started it
> running. Now I can see the output when WAMP is running so the browser
> would appear to be accessing the server. The server is currently
> offline but I still get the output on my browser.
>
> Thanks,
> Peter.

The server is not offline. It is running, or your browser would get a
connection error message.

It may not be available to the internet (and should NOT be as others
have pointed out), but it is running.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173463 is a reply to message #173435] Wed, 13 April 2011 19:13 Go to previous messageGo to next message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma: 0
Member
On 4/12/2011 11:43 PM, Peter Lauren wrote:
> I have no problem with localhost except that Denis seems to be saying
> that it won't work over the Internet. I'm new at this so may be
> misinterpreting what he is saying.

Yes, I think you are misunderstanding what he is saying. Elsewhere I
suggested you look at things in pieces. I missed one; DNS. The internet
is millions of computers connected, each having a unique (well
technically that can be obfuscated too) address. Rather than having to
know the actual address of each, they devised a naming system so that
rather than having to remember 74.125.225.17, a user just asks for
Google.com. Some addresses are nonroutable (can't be used across the
internet. i.e. 192.x.x.x) and one is even more restricted, "127.0.0.1".
It is named localhost (meaning this computer).

All public DNS names are registered to prevent conflict on the internet.
However, you can override the "name to address" look up via your hosts
file. For example you could add the line "www.google.com 127.0.0.1"
then whenever you enter "www.google.com" into your browser, it will go
to your local host (assuming you are running a properly configured
server). BUT and this in important, only the computer whose hosts file
has been modified will do this. Everyone else will go to the actual
www.google.com site.

Now back to your misinterpretation. If you use localhost to build and
test, 'href="http://localhost/path/file.type"' will work on your server
but no one else's. You would either need to replace the
"http://localhost" part with the actual server name (i.e.
"http://www.example.com"), OR you could use a reference that tells the
server "Find 'path/file.type' in the domain that got you here to begin
with", then the "href=" would work on your localhost/development server
AND ALSO on the public server when you publish the page.
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173464 is a reply to message #173463] Wed, 13 April 2011 19:21 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <io4sks$c98$1(at)dont-email(dot)me>,
William Gill <nospam(at)domain(dot)invalid> wrote:

> internet. i.e. 192.x.x.x) and one is even more restricted, "127.0.0.1".

> "http://localhost" part with the actual server name (i.e.
> "http://www.example.com"), OR you could use a reference that tells the

In both cases you mean "e.g." and not "i.e", otherwise a good
explanation.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173466 is a reply to message #173434] Wed, 13 April 2011 20:57 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Tue, 12 Apr 2011 20:33:54 -0700, Peter Lauren wrote:

> I would like to run PHP and Java code on my own browser and over the
> Internet. It will be called from an hyml file that is on my local PC.

You can not run php code on your browser.

php code as you understand it runs in a script processor that operates
within a web server environment and generates output that that web server
then delivers to a web browser across an internet connection.

Rgds

Denis McMahon
Re: PHP Runs In WinXP Command Window But Not In Browser [message #173468 is a reply to message #173464] Wed, 13 April 2011 23:22 Go to previous messageGo to previous message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma: 0
Member
On 4/13/2011 3:21 PM, Tim Streater wrote:

> In both cases you mean "e.g." and not "i.e", otherwise a good explanation.

Well I was very tired, and its been over a half century since I studied
Latin. However, "that is" still works (though "for example" works better.)
Pages (4): [ «    1  2  3  4    »]  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Nov 13 09:26:24 GMT 2024

Total time taken to generate the page: 0.03199 seconds