Error on CMS Builder Upgrade (Undefined index: SCRIPT_FILENAME)

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 26, 2010   (RSS)

By rconring - January 25, 2010 - edited: January 26, 2010

I recently attempted to update an installation of CMS Builder on a Windows server from 1.27 to 2.1 and got an error message on Admin startup which began with:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at D:/hshome/rconring/gratefuldogbakery.com/cmsAdmin.admin.php:1) in D:/hshome/rconring/gratefuldogbakery.com/cmsAdmin/lib/init.php on line 60 something ........ and a couple of other errors.

Tried working with Hosting support, but they say all is OK there. I tend to believe them since I have another CMS installed on the same hosting account running version 1.34 with no problem. Does this problem sound familiar? Would going to version 2.2 solve the problem?

I finally had to restore the 1.27 backup.
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

Re: [Dave] Error on CMS Builder Upgrade

By Dave - January 26, 2010

Just a follow up on this. I upgraded the CMSB to 2.02 (latest release) and fixed a bug that may occur on some Windows IIS installs.

If you're running Windows IIS and you get a "Undefined index: SCRIPT_FILENAME" error, here's some steps to patch it:

- Open /cmsAdmin/lib/init.php
- Search for: DOCUMENT_ROOT
- Replace the block of code with this:

// fix DOCUMENT_ROOT - Not set on Windows and often incorrect in Apache virtual hosting configurations
if (!@$_SERVER['DOCUMENT_ROOT'] || !is_dir(@$_SERVER['DOCUMENT_ROOT'])) {
$callers = debug_backtrace();
$fullFilepath = strtr( @$callers[1]['file'], '\\', '/'); // eg: C:/wamp/www/application/admin.php
$pathFromWebRoot = strtr($_SERVER['SCRIPT_NAME'], '\\', '/'); // eg: /application/admin.php
$webRootDir = str_replace($pathFromWebRoot, '/', $fullFilepath); // eg: C:/wamp/www
if (is_dir($webRootDir)) { $_SERVER['DOCUMENT_ROOT'] = $webRootDir; }
}


Let me know if anyone has any other issues with this.

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Error on CMS Builder Upgrade

Dave ...

Thank you profusely for the quick and efficient response.

Interactive Tools is, without a doubt, the benchmark for customer support!

I do have another CMSB on that server to upgrade at some future date, so I'll let you know if it goes awry.
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987