PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > SERVER_PORT always at 80 ?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
SERVER_PORT always at 80 ?

Réponse
 
LinkBack Outils de la discussion
Vieux 11/04/2008, 13h27   #1
Julien Pauli
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SERVER_PORT always at 80 ?

Hi all, I'm running Windows XP, and here is a piece of my apache (2.2.8)
conf :

--- httpd.conf ---
.... ... ...
Listen 81
Listen 80
Listen 8080
LoadModule php5_module "e:/php/php5apache2_2.dll"
LoadModule fastcgi_module modules/mod_fastcgi.dll
AddType application/x-httpd-php .php
.... ... ...

--- vhosts.conf ----

NameVirtualHost 127.0.0.1:81

<VirtualHost 127.0.0.1:81>
ServerName myserver
DocumentRoot e:/www
ScriptAlias /php/ "e:/php53/"
Action php5-fastcgi "/php/php-cgi.exe"
AddHandler php5-fastcgi .php
</VirtualHost>

That's a configuration to be able to run both PHP 5.2 (as apache module),
and PHP 5.3 (throught fast-cgi) on the same apache2 instance.
There are no apache rewrite rules in my stuff.

All works right, the only problem is that in both cases,
$_SERVER["SERVER_PORT"] returns 80, even when I'm connected throught port
81.

Is it a fastcgi / Apache bug or does it come from PHP or even me :-) ?


Cheers
Julien.P

  Réponse avec citation
Vieux 11/04/2008, 15h19   #2
Thiago Pojda
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RES: [PHP] SERVER_PORT always at 80 ?

{Top posting}

What shows your phpinfo() on both ports?

Is it really running your 5.3 in :81?


Regards,
Thiago

-----Mensagem original-----
De: Julien Pauli [mailto:doctorrock83@gmail.com]
Enviada em: sexta-feira, 11 de abril de 2008 09:28
Para: PHP General list
Assunto: [php] SERVER_PORT always at 80 ?

Hi all, I'm running Windows XP, and here is a piece of my
apache (2.2.8) conf :

--- httpd.conf ---
.... ... ...
Listen 81
Listen 80
Listen 8080
LoadModule php5_module "e:/php/php5apache2_2.dll"
LoadModule fastcgi_module modules/mod_fastcgi.dll AddType
application/x-httpd-php .php ... ... ...

--- vhosts.conf ----

NameVirtualHost 127.0.0.1:81

<VirtualHost 127.0.0.1:81>
ServerName myserver
DocumentRoot e:/www
ScriptAlias /php/ "e:/php53/"
Action php5-fastcgi "/php/php-cgi.exe"
AddHandler php5-fastcgi .php
</VirtualHost>

That's a configuration to be able to run both PHP 5.2 (as
apache module), and PHP 5.3 (throught fast-cgi) on the same
apache2 instance.
There are no apache rewrite rules in my stuff.

All works right, the only problem is that in both cases,
$_SERVER["SERVER_PORT"] returns 80, even when I'm connected
throught port 81.

Is it a fastcgi / Apache bug or does it come from PHP or even me :-) ?


Cheers
Julien.P


  Réponse avec citation
Vieux 14/04/2008, 08h00   #3
Julien Pauli
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SERVER_PORT always at 80 ?

Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....

Regards, Julien.P

2008/4/11 Thiago Pojda <thiago.pojda@softpartech.com.br>:

> {Top posting}
>
> What shows your phpinfo() on both ports?
>
> Is it really running your 5.3 in :81?
>
>
> Regards,
> Thiago
>
> -----Mensagem original-----
> De: Julien Pauli [mailto:doctorrock83@gmail.com]
> Enviada em: sexta-feira, 11 de abril de 2008 09:28
> Para: PHP General list
> Assunto: [php] SERVER_PORT always at 80 ?
>
> Hi all, I'm running Windows XP, and here is a piece of my
> apache (2.2.8) conf :
>
> --- httpd.conf ---
> ... ... ...
> Listen 81
> Listen 80
> Listen 8080
> LoadModule php5_module "e:/php/php5apache2_2.dll"
> LoadModule fastcgi_module modules/mod_fastcgi.dll AddType
> application/x-httpd-php .php ... ... ...
>
> --- vhosts.conf ----
>
> NameVirtualHost 127.0.0.1:81
>
> <VirtualHost 127.0.0.1:81>
> ServerName myserver
> DocumentRoot e:/www
> ScriptAlias /php/ "e:/php53/"
> Action php5-fastcgi "/php/php-cgi.exe"
> AddHandler php5-fastcgi .php
> </VirtualHost>
>
> That's a configuration to be able to run both PHP 5.2 (as
> apache module), and PHP 5.3 (throught fast-cgi) on the same
> apache2 instance.
> There are no apache rewrite rules in my stuff.
>
> All works right, the only problem is that in both cases,
> $_SERVER["SERVER_PORT"] returns 80, even when I'm connected
> throught port 81.
>
> Is it a fastcgi / Apache bug or does it come from PHP or even me :-) ?
>
>
> Cheers
> Julien.P
>
>
>


  Réponse avec citation
Vieux 14/04/2008, 08h17   #4
mike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SERVER_PORT always at 80 ?

I would think PHP is just passing through what it receives from
Apache. I assume it's just passing through environment variables it
gets from the server.

Can you disable all the other ports and only have :81 running to
ensure there is no confusion?

On 4/14/08, Julien Pauli <doctorrock83@gmail.com> wrote:
> Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....
>
> Regards, Julien.P

  Réponse avec citation
Vieux 14/04/2008, 16h08   #5
Julien Pauli
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SERVER_PORT always at 80 ?

Ok I did that, but it's the same.
HTTP_HOST says myhost:81 , but SERVER_PORT still says 80....

Cheers
Julien.P

2008/4/14 mike <mike503@gmail.com>:

> I would think PHP is just passing through what it receives from
> Apache. I assume it's just passing through environment variables it
> gets from the server.
>
> Can you disable all the other ports and only have :81 running to
> ensure there is no confusion?
>
> On 4/14/08, Julien Pauli <doctorrock83@gmail.com> wrote:
> > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....
> >
> > Regards, Julien.P

>


  Réponse avec citation
Vieux 14/04/2008, 19h57   #6
mike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SERVER_PORT always at 80 ?

you should try Perl or another language. See if you can isolate it to Apache.
..
Or, you could try to track it down inside of the PHP source and see if
for some reason it is hardcoded or incorrectly set. (However, I still
think it's from Apache)

On 4/14/08, Julien Pauli <doctorrock83@gmail.com> wrote:
> Ok I did that, but it's the same.
> HTTP_HOST says myhost:81 , but SERVER_PORT still says 80....
>
> Cheers
> Julien.P
>
> 2008/4/14 mike <mike503@gmail.com>:
>
> > I would think PHP is just passing through what it receives from
> > Apache. I assume it's just passing through environment variables it
> > gets from the server.
> >
> > Can you disable all the other ports and only have :81 running to
> > ensure there is no confusion?
> >
> >
> >
> >
> > On 4/14/08, Julien Pauli <doctorrock83@gmail.com> wrote:
> > > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80....
> > >
> > > Regards, Julien.P

> >

>
>

  Réponse avec citation
Vieux 17/04/2008, 18h25   #7
Julien Pauli
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SERVER_PORT always at 80 ?

I read the source yes, but my C skills are not good enought to say.
I think about an Apache problem as well, I dont see why it would have been
hardcoded into PHP source (and I cant find it hardcoded anyway ...).

I will try another language, or even another server, to see ....

thx

Julien.P

2008/4/14 mike <mike503@gmail.com>:

> you should try Perl or another language. See if you can isolate it to
> Apache.
> .
> Or, you could try to track it down inside of the PHP source and see if
> for some reason it is hardcoded or incorrectly set. (However, I still
> think it's from Apache)
>
> On 4/14/08, Julien Pauli <doctorrock83@gmail.com> wrote:
> > Ok I did that, but it's the same.
> > HTTP_HOST says myhost:81 , but SERVER_PORT still says 80....
> >
> > Cheers
> > Julien.P
> >
> > 2008/4/14 mike <mike503@gmail.com>:
> >
> > > I would think PHP is just passing through what it receives from
> > > Apache. I assume it's just passing through environment variables it
> > > gets from the server.
> > >
> > > Can you disable all the other ports and only have :81 running to
> > > ensure there is no confusion?
> > >
> > >
> > >
> > >
> > > On 4/14/08, Julien Pauli <doctorrock83@gmail.com> wrote:
> > > > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port

> 80....
> > > >
> > > > Regards, Julien.P
> > >

> >
> >

>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h27.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16463 seconds with 15 queries