Error on CMS Builder Upgrade (Undefined index: SCRIPT_FILENAME)

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

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

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