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

Home » Imported messages » comp.lang.php » Accessing IIS variables from PHP after URL Rewrite
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Accessing IIS variables from PHP after URL Rewrite [message #177052] Fri, 17 February 2012 23:32 Go to next message
Peter Heald is currently offline  Peter Heald
Messages: 2
Registered: February 2012
Karma: 0
Junior Member
Hi all,

I have a working URL Rewrite rule (that simply steps 'up' one dir on
the site) and as part of the rule, I set a server variable. However I
cannot access this from PHP. I always get the old value of the
variable; it's as if the rule never set the variable (or perhaps PHP
is picking it up from a cached $_SERVER array containing the old
variables?). I've tried existing variables (such as REQUEST_URI) and
new variables. Either way, I add it to the list of allowed variables
in IIS. I've tried the rule at site level and dir level, nothing seems
to help. As I say, the rule works fine, there are no errors, just the
variable value is not set. It's driving me nuts - any help would be
much appreciated!

Pete
Re: Accessing IIS variables from PHP after URL Rewrite [message #177115 is a reply to message #177052] Wed, 22 February 2012 22:36 Go to previous messageGo to next message
Peter Heald is currently offline  Peter Heald
Messages: 2
Registered: February 2012
Karma: 0
Junior Member
On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
> Hi all,
>
> I have a working URL Rewrite rule (that simply steps 'up' one dir on
> the site) and as part of the rule, I set a server variable. However I
> cannot access this from PHP. I always get the old value of the
> variable; it's as if the rule never set the variable (or perhaps PHP
> is picking it up from a cached $_SERVER array containing the old
> variables?). I've tried existing variables (such as REQUEST_URI) and
> new variables. Either way, I add it to the list of allowed variables
> in IIS. I've tried the rule at site level and dir level, nothing seems
> to help. As I say, the rule works fine, there are no errors, just the
> variable value is not set. It's driving me nuts - any help would be
> much appreciated!
>
> Pete

Problem is solved. In fact, many of the problems I've been
experiencing seem to suddenly be ok after applying a heap of Windows
Update patches to the server...
Re: Accessing IIS variables from PHP after URL Rewrite [message #177116 is a reply to message #177115] Wed, 22 February 2012 23:26 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
Peter Heald wrote:
> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>> Hi all,
>>
>> I have a working URL Rewrite rule (that simply steps 'up' one dir on
>> the site) and as part of the rule, I set a server variable. However I
>> cannot access this from PHP. I always get the old value of the
>> variable; it's as if the rule never set the variable (or perhaps PHP
>> is picking it up from a cached $_SERVER array containing the old
>> variables?). I've tried existing variables (such as REQUEST_URI) and
>> new variables. Either way, I add it to the list of allowed variables
>> in IIS. I've tried the rule at site level and dir level, nothing seems
>> to help. As I say, the rule works fine, there are no errors, just the
>> variable value is not set. It's driving me nuts - any help would be
>> much appreciated!
>>
>> Pete
>
> Problem is solved. In fact, many of the problems I've been
> experiencing seem to suddenly be ok after applying a heap of Windows
> Update patches to the server...

why ever would one run php on a windows server?
Re: Accessing IIS variables from PHP after URL Rewrite [message #177125 is a reply to message #177116] Thu, 23 February 2012 12:52 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
On 2/23/2012 12:26 AM, The Natural Philosopher wrote:
> Peter Heald wrote:
>> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>>> Hi all,
>>>
>>> I have a working URL Rewrite rule (that simply steps 'up' one dir on
>>> the site) and as part of the rule, I set a server variable. However I
>>> cannot access this from PHP. I always get the old value of the
>>> variable; it's as if the rule never set the variable (or perhaps PHP
>>> is picking it up from a cached $_SERVER array containing the old
>>> variables?). I've tried existing variables (such as REQUEST_URI) and
>>> new variables. Either way, I add it to the list of allowed variables
>>> in IIS. I've tried the rule at site level and dir level, nothing seems
>>> to help. As I say, the rule works fine, there are no errors, just the
>>> variable value is not set. It's driving me nuts - any help would be
>>> much appreciated!
>>>
>>> Pete
>>
>> Problem is solved. In fact, many of the problems I've been
>> experiencing seem to suddenly be ok after applying a heap of Windows
>> Update patches to the server...
>
> why ever would one run php on a windows server?

Because the boss/client says so.
Because the IT-professionals maintaining the system can only maintain
Microsoft systems.
Well, I guess you can think up a few yourself too. :-)

Regards,
Erwin Moller


--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
Re: Accessing IIS variables from PHP after URL Rewrite [message #177129 is a reply to message #177125] Thu, 23 February 2012 13:18 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Feb 23, 12:52 pm, Erwin Moller <erwinmolleruse...@xs4all.nl> wrote:
> On 2/23/2012 12:26 AM, The Natural Philosopher wrote:
>
>
>
>
>
>
>
>
>
>> Peter Heald wrote:
>>> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>>>> Hi all,
>
>>>> I have a working URL Rewrite rule (that simply steps 'up' one dir on
>>>> the site) and as part of the rule, I set a server variable. However I
>>>> cannot access this from PHP. I always get the old value of the
>>>> variable; it's as if the rule never set the variable (or perhaps PHP
>>>> is picking it up from a cached $_SERVER array containing the old
>>>> variables?). I've tried existing variables (such as REQUEST_URI) and
>>>> new variables. Either way, I add it to the list of allowed variables
>>>> in IIS. I've tried the rule at site level and dir level, nothing seems
>>>> to help. As I say, the rule works fine, there are no errors, just the
>>>> variable value is not set. It's driving me nuts - any help would be
>>>> much appreciated!
>
>>>> Pete
>
>>> Problem is solved. In fact, many of the problems I've been
>>> experiencing seem to suddenly be ok after applying a heap of Windows
>>> Update patches to the server...
>
>> why ever would one run php on a windows server?
>
> Because the boss/client says so.
> Because the IT-professionals maintaining the system can only maintain
> Microsoft systems.
> Well, I guess you can think up a few yourself too. :-)

Because setting up FastCGI is a lot easier (than on Apache)
Re: Accessing IIS variables from PHP after URL Rewrite [message #177132 is a reply to message #177125] Thu, 23 February 2012 13:29 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
Erwin Moller wrote:
> On 2/23/2012 12:26 AM, The Natural Philosopher wrote:
>> Peter Heald wrote:
>>> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>>>> Hi all,
>>>>
>>>> I have a working URL Rewrite rule (that simply steps 'up' one dir on
>>>> the site) and as part of the rule, I set a server variable. However I
>>>> cannot access this from PHP. I always get the old value of the
>>>> variable; it's as if the rule never set the variable (or perhaps PHP
>>>> is picking it up from a cached $_SERVER array containing the old
>>>> variables?). I've tried existing variables (such as REQUEST_URI) and
>>>> new variables. Either way, I add it to the list of allowed variables
>>>> in IIS. I've tried the rule at site level and dir level, nothing seems
>>>> to help. As I say, the rule works fine, there are no errors, just the
>>>> variable value is not set. It's driving me nuts - any help would be
>>>> much appreciated!
>>>>
>>>> Pete
>>>
>>> Problem is solved. In fact, many of the problems I've been
>>> experiencing seem to suddenly be ok after applying a heap of Windows
>>> Update patches to the server...
>>
>> why ever would one run php on a windows server?
>
> Because the boss/client says so.
> Because the IT-professionals maintaining the system can only maintain
> Microsoft systems.
> Well, I guess you can think up a few yourself too. :-)
>

Like the IT manager was brain damaged at birth.
Or is paid a huge kickback from Gatesy.


But none of these would seem to apply to the poster, who displays almost
normal intelligence.


> Regards,
> Erwin Moller
>
>
Re: Accessing IIS variables from PHP after URL Rewrite [message #177133 is a reply to message #177129] Thu, 23 February 2012 13:32 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
Captain Paralytic wrote:
> On Feb 23, 12:52 pm, Erwin Moller <erwinmolleruse...@xs4all.nl> wrote:
>> On 2/23/2012 12:26 AM, The Natural Philosopher wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> Peter Heald wrote:
>>>> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>>>> > Hi all,
>>>> > I have a working URL Rewrite rule (that simply steps 'up' one dir on
>>>> > the site) and as part of the rule, I set a server variable. However I
>>>> > cannot access this from PHP. I always get the old value of the
>>>> > variable; it's as if the rule never set the variable (or perhaps PHP
>>>> > is picking it up from a cached $_SERVER array containing the old
>>>> > variables?). I've tried existing variables (such as REQUEST_URI) and
>>>> > new variables. Either way, I add it to the list of allowed variables
>>>> > in IIS. I've tried the rule at site level and dir level, nothing seems
>>>> > to help. As I say, the rule works fine, there are no errors, just the
>>>> > variable value is not set. It's driving me nuts - any help would be
>>>> > much appreciated!
>>>> > Pete
>>>> Problem is solved. In fact, many of the problems I've been
>>>> experiencing seem to suddenly be ok after applying a heap of Windows
>>>> Update patches to the server...
>>> why ever would one run php on a windows server?
>> Because the boss/client says so.
>> Because the IT-professionals maintaining the system can only maintain
>> Microsoft systems.
>> Well, I guess you can think up a few yourself too. :-)
>
> Because setting up FastCGI is a lot easier (than on Apache)
>
It looks of a similar order of complexity to setting up - say - a
virtual web site.
Re: Accessing IIS variables from PHP after URL Rewrite [message #177139 is a reply to message #177132] Thu, 23 February 2012 13:54 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
On 2/23/2012 2:29 PM, The Natural Philosopher wrote:
> Erwin Moller wrote:
>> On 2/23/2012 12:26 AM, The Natural Philosopher wrote:
>>> Peter Heald wrote:
>>>> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>>>> > Hi all,
>>>> >
>>>> > I have a working URL Rewrite rule (that simply steps 'up' one dir on
>>>> > the site) and as part of the rule, I set a server variable. However I
>>>> > cannot access this from PHP. I always get the old value of the
>>>> > variable; it's as if the rule never set the variable (or perhaps PHP
>>>> > is picking it up from a cached $_SERVER array containing the old
>>>> > variables?). I've tried existing variables (such as REQUEST_URI) and
>>>> > new variables. Either way, I add it to the list of allowed variables
>>>> > in IIS. I've tried the rule at site level and dir level, nothing seems
>>>> > to help. As I say, the rule works fine, there are no errors, just the
>>>> > variable value is not set. It's driving me nuts - any help would be
>>>> > much appreciated!
>>>> >
>>>> > Pete
>>>>
>>>> Problem is solved. In fact, many of the problems I've been
>>>> experiencing seem to suddenly be ok after applying a heap of Windows
>>>> Update patches to the server...
>>>
>>> why ever would one run php on a windows server?
>>
>> Because the boss/client says so.
>> Because the IT-professionals maintaining the system can only maintain
>> Microsoft systems.
>> Well, I guess you can think up a few yourself too. :-)
>>
>
> Like the IT manager was brain damaged at birth.
> Or is paid a huge kickback from Gatesy.
>
>
> But none of these would seem to apply to the poster, who displays almost
> normal intelligence.
>

:-)
I understand your irritation.

I have seen a lot Microsoft-only companies, big and small.
Especially the smaller ones can't afford a real IT staff and just do
things the way they do things at home, where, of course, they run some
version of windows. And hence they roll out MS-only solutions at work too.
And the longer they invested in it, the harder it is to change.
(Also psychology and pride plays an important role: "I told my company
to use only Microsoft, so that must have been the right choice.".)

I also met many people with low/none IT skills who associate anything
non-Microsoft with "hackers", "crackers", "geeks", etc, and so they
don't trust it.
In the meantime, most systems that *are* compromised are running
Microsoft software.

I don't know how this kind of double-thinking was implemented on the
public at large, but that's how it is nowadays.

I for myself stopped caring too much, and just use whatever is thrown at
me. ;-)

If I start a new project, and the client asks for my advice I will tell
them to use Postgresql/PHP on some nice distro. :-)
But most often the environment is already set to Microsoft, and I am
happy if I can use PHP, even if it is on Windows.
PHP on IIS7 instead of Apache? Fine too.
Anything beats Classic ASP on IIS. ;-)

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
Re: Accessing IIS variables from PHP after URL Rewrite [message #177153 is a reply to message #177116] Fri, 24 February 2012 12:43 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 23/02/2012 0:26, The Natural Philosopher escribió/wrote:
> Peter Heald wrote:
>> On Feb 17, 3:32 pm, Peter Heald <petehe...@gmail.com> wrote:
>>> Hi all,
>>>
>>> I have a working URL Rewrite rule (that simply steps 'up' one dir on
>>> the site) and as part of the rule, I set a server variable. However I
>>> cannot access this from PHP. I always get the old value of the
>>> variable; it's as if the rule never set the variable (or perhaps PHP
>>> is picking it up from a cached $_SERVER array containing the old
>>> variables?). I've tried existing variables (such as REQUEST_URI) and
>>> new variables. Either way, I add it to the list of allowed variables
>>> in IIS. I've tried the rule at site level and dir level, nothing seems
>>> to help. As I say, the rule works fine, there are no errors, just the
>>> variable value is not set. It's driving me nuts - any help would be
>>> much appreciated!
>>>
>>> Pete
>>
>> Problem is solved. In fact, many of the problems I've been
>> experiencing seem to suddenly be ok after applying a heap of Windows
>> Update patches to the server...
>
> why ever would one run php on a windows server?

I agree with that. Other people's habit of not complying with all your
personal preferences is absolutely annoying :)



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: way to turn off strict option? Use of undefined constant
Next Topic: FastCGI & PHP
Goto Forum:
  

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

Current Time: Sun Nov 10 15:37:48 GMT 2024

Total time taken to generate the page: 0.02880 seconds