Page 1 of 1

Yet another IIS + PHP5 error

Posted: Wed Dec 14, 2005 1:27 pm
by bjaergager
As a happy camper I just installed cmsms Version 0.11.1
My server is a Win2000Server SP4 fully patched, IIS5, PHP 5.1.1, MySQL 4.1

The installation went by smoothly, only issue SITEDOWN manually removed.

Now I try to access the default site and I get this :
Notice: Undefined index: REQUEST_URI in E:\cms.doktorgren.dk\index.php on line 24

Please help/hints/etc if possible, I'm a newbie at cmsms (duh!) and also at PHP, have been coding ASP for last 5 yrs.

For PHP setup see http://cms.doktorgren.dk/info.php

For error see http://cms.doktorgren.dk

Thanks for any help you might provide.

Cheers,
Mark

Re: Yet another IIS + PHP5 error

Posted: Wed Dec 14, 2005 1:38 pm
by petert
http://nl2.php.net/reserved.variables
eustf at hotmail dot com
21-Jul-2005 05:05

REQUEST_URI not defined on Windows XP and IIS 5.1
I have seen different script on the web and in this list but they don't work fully. This one seems to work:

if(!isset($_SERVER['REQUEST_URI'])) {
  $arr = explode("/", $_SERVER['PHP_SELF']);
  $_SERVER['REQUEST_URI'] = "/" . $arr[count($arr)-1];
  if ($_SERVER['argv'][0]!="")
  $_SERVER['REQUEST_URI'] .= "?" . $_SERVER['argv'][0];
}


purplebz at hotmail dot com
19-Jun-2005 10:35
How to get $_SERVER['REQUEST_URI'] on IIS (WinXP):

if ( empty($_SERVER['REQUEST_URI']) ) {
  $arr = explode("/", $_SERVER['PHP_SELF']);
  $_SERVER['REQUEST_URI'] = $arr[count($arr)-1];
}

josh,endquote,com
04-Dec-2003 12:54
Running PHP 4.3 under IIS 5 on Windows XP, there is no $_SERVER['REQUEST_URI'] variable. This seems to fix it:

if(!isset($_SERVER['REQUEST_URI'])) {
  $_SERVER['REQUEST_URI'] = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1);
}

Re: Yet another IIS + PHP5 error

Posted: Wed Dec 14, 2005 1:56 pm
by bjaergager
??? So can you help me how to implement one of those snippets ??

Thx,
Mark

Re: Yet another IIS + PHP5 error

Posted: Wed Dec 14, 2005 1:59 pm
by bjaergager
bjaergager wrote: ??? So can you help me how to implement one of those snippets ??

Thx,
Mark
And so he tried to do it anyways...
In include.php I found the fix, lin 188, and pasted your top example, now I got these errors:

Notice: Undefined index: REQUEST_URI in E:\cms.doktorgren.dk\index.php on line 24

Notice: Undefined offset: 0 in E:\cms.doktorgren.dk\include.php on line 197

Anyone ?
Cheers,
Mark

Re: Yet another IIS + PHP5 error

Posted: Wed Dec 14, 2005 2:01 pm
by petert
bjaergager wrote: So can you help me how to implement one of those snippets ??
I would report it as a bug (not really true, I would throw windows out and use a decent os).
Go to http://dev.cmsmadesimple.org/tracker/?a ... unc=browse and report it please.

Re: Yet another IIS + PHP5 error

Posted: Wed Dec 14, 2005 2:09 pm
by bjaergager
petert wrote:
bjaergager wrote: So can you help me how to implement one of those snippets ??
I would report it as a bug (not really true, I would throw windows out and use a decent os).
Go to http://dev.cmsmadesimple.org/tracker/?a ... unc=browse and report it please.
;D If only I could, but my *nix resources are (very) limited

Thx anyways

Re: Yet another IIS + PHP5 error - Downgraded to PHP 4.4.1

Posted: Wed Dec 14, 2005 10:31 pm
by bjaergager
OK, so I thought I might try to downgrade to PHP4, from what I read, that works like a charm !

Not  :o After installing php4.4.1, the result is.... well, the same.

Any bidders as to why this wont work on IIS, from what I read it should be able to work using php4, do I need a earlier version of php4 ?

phpinfo : http://cms.doktorgren.dk/info.php
site : http://cms.doktorgren.dk

Thanks for any help!

Cheers,
Mark

Re: Yet another IIS + PHP5 error - Downgraded to PHP 4.4.1

Posted: Fri Dec 16, 2005 6:58 pm
by petert
bjaergager wrote: OK, so I thought I might try to downgrade to PHP4, from what I read, that works like a charm !

Not  :o After installing php4.4.1, the result is.... well, the same.
Why did you do that?
Didn't you read:

Code: Select all

REQUEST_URI not defined on Windows XP and IIS 5.1
bjaergager wrote: Any bidders as to why this wont work on IIS, from what I read it should be able to work using php4, do I need a earlier version of php4 ?

phpinfo : http://cms.doktorgren.dk/info.php
site : http://cms.doktorgren.dk

Thanks for any help!

Cheers,
Mark
it's an iis problem, not a php problem.

Re: Yet another IIS + PHP5 error - Downgraded to PHP 4.4.1

Posted: Sat Dec 17, 2005 6:03 am
by bjaergager
petert wrote:
bjaergager wrote: OK, so I thought I might try to downgrade to PHP4, from what I read, that works like a charm !

Not  :o After installing php4.4.1, the result is.... well, the same.
Why did you do that?
Didn't you read:

Code: Select all

REQUEST_URI not defined on Windows XP and IIS 5.1
bjaergager wrote: Any bidders as to why this wont work on IIS, from what I read it should be able to work using php4, do I need a earlier version of php4 ?

phpinfo : http://cms.doktorgren.dk/info.php
site : http://cms.doktorgren.dk

Thanks for any help!

Cheers,
Mark
it's an iis problem, not a php problem.
I guess I had to try something, so I had a go using php4, I have read posts where there's a lot of problems using php5, wasn't sure if this could help.!

Thanks for your reply.

Cheers,Mark

Re: Yet another IIS + PHP5 error

Posted: Sun Jan 01, 2006 2:44 pm
by Fabiana
Hey Mark

I had the exact same problem you had. I don't know if you've solved it but I surprisingly got it to work. What I did was:
1) Edited the index.php file on the root directory, I changed the code as below: (Those are actually the first lines of the code. I just added a script to get the REQUEST_URI variable before requesting it in line 24. See?

require_once(dirname(__FILE__).'/fileloc.php');

$log =& LoggerManager::getLogger('index.php');
-------------------------------------------------------------------that's the script I inserted-------------------
if ( empty($_SERVER['REQUEST_URI']) ) {
  $arr = explode("/", $_SERVER['PHP_SELF']);
  $_SERVER['REQUEST_URI'] = $arr[count($arr)-1];
}
---------------------------------------------------------------------------------------------------------------------------
$log->info('Serving URL:' . $_SERVER['REQUEST_URI']);
$log->debug('Starting index.php');



apparently, it's all working now. Let me know if you succeeded too, ok?!

Cheers
Fabiana

Re: Yet another IIS + PHP5 error

Posted: Sun Jan 01, 2006 8:21 pm
by petert
Fabiana wrote: I had the exact same problem you had. I don't know if you've solved it but I surprisingly got it to work. What I did was:
Nice to see you got it fixed.