Yet another IIS + PHP5 error

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
bjaergager

Yet another IIS + PHP5 error

Post 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
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: Yet another IIS + PHP5 error

Post 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);
}
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
bjaergager

Re: Yet another IIS + PHP5 error

Post by bjaergager »

??? So can you help me how to implement one of those snippets ??

Thx,
Mark
bjaergager

Re: Yet another IIS + PHP5 error

Post 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
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: Yet another IIS + PHP5 error

Post 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.
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
bjaergager

Re: Yet another IIS + PHP5 error

Post 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
bjaergager

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

Post 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
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

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

Post 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.
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
bjaergager

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

Post 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
Fabiana

Re: Yet another IIS + PHP5 error

Post 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
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: Yet another IIS + PHP5 error

Post 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.
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
Locked

Return to “[locked] Installation, Setup and Upgrade”