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: [rconring] Error on CMS Builder Upgrade

By Dave - January 25, 2010

Hi rconring,

Thanks for your message. Was the upgrade to the latest beta or to the latest release version?

Can you email me CMS and FTP login details to dave@interactivetools.com for this server? I can do a new install beside the old one and track down the problem. It's likely just one of the hosting settings that is conflicting. Usually we can just override that in the problem. Note: email, don't post login details to the forum.

Thanks!
Dave Edis - Senior Developer
interactivetools.com

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