Strict and Rename errors installing CMSB 2.17

11 posts by 4 authors in: Forums > CMS Builder
Last Post: December 20, 2012   (RSS)

By garyhoffmann - September 25, 2012 - edited: September 25, 2012

Hi,
I’m in the process of taking my “standard installation” which is on CMSB 2.14 and trying to update it to 2.17.

To keep things really simple, I’m starting with a “vanilla” 2.17 installation. Ultimately, I have a lot of pre-defined schema files that are all based on 2.14 schema methodology that I’d like to bring forward, but I thought I’d start simple.

When I first upload all the files to the site and try to run the CMS Installer, I’m getting errors that I’ve never received before:

First, I’m getting a Strict warning regarding the timezone (windows server BTW) and then I’m getting a rename error – I believe what’s happening is the settings.dat.php.default is being successfully renamed to settings.data.php, but then it’s trying to update the settings to V2.17 “correct” values and fails renaming the temp file to settings.dat.php because the file already exists.

The attachment shows the file has been renamed and it fails while trying to rename a second time.

Strict Standards: rename(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for '-5.0/DST' instead in C:\Inetpub\vhosts\zslegal.com\httpdocs\cmsAdmin\lib\common.php on line 444 Warning: rename(C:/Inetpub/vhosts/zslegal.com/httpdocs/cmsAdmin/data/settings.dat.php.50626b78c549b2.77836685-temp.php,C:/Inetpub/vhosts/zslegal.com/httpdocs/cmsAdmin/data/settings.dat.php): File exists in C:\Inetpub\vhosts\zslegal.com\httpdocs\cmsAdmin\lib\common.php on line 444 Error renaming over C:/Inetpub/vhosts/zslegal.com/httpdocs/cmsAdmin/data/settings.dat.php: rename(C:/Inetpub/vhosts/zslegal.com/httpdocs/cmsAdmin/data/settings.dat.php.50626b78c549b2.77836685-temp.php,C:/Inetpub/vhosts/zslegal.com/httpdocs/cmsAdmin/data/settings.dat.php): File exists

I do not have these problems in CMSB 2.14 nor have I ever had this type of problem going all the way back to V1.3*, so it's something that has changed very recently.
Attachments:

9-25-2012-9-43-13-pm.png 30K

Re: [garyhoffmann] Strict and Rename errors installing CMSB 2.17

By Dave - September 26, 2012

Hi Gary,

Thanks for the report.

I just came across this same issue myself, that on windows rename() doesn't overwrite files in PHP < 5.3.

I've updated the code for the next release to use rename_winsafe (and optimized/tested that function).

It only uses the rename() overwrite functionality in common.php, so the quick fix is just to replace rename with rename_winsafe, or alternatively just upgrade PHP to 5.3 or better.

Also, note that for the next release of CMSB we're going to be upping the server requirements to PHP 5.2.4+ and MySQL 5.0+, so if you're running lower version then those it might be a good time to upgrade as well.

Hope that helps, let me know any questions.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Strict and Rename errors installing CMSB 2.17

By ITI - November 28, 2012

Hi Dave

I've updated the code for the next release to use rename_winsafe (and optimized/tested that function).

It only uses the rename() overwrite functionality in common.php, so the quick fix is just to replace rename with rename_winsafe, or alternatively just upgrade PHP to 5.3 or better.

Also, note that for the next release of CMSB we're going to be upping the server requirements to PHP 5.2.4+ and MySQL 5.0+, so if you're running lower version then those it might be a good time to upgrade as well.



I also ran into this issue trying to do a fresh install.
Regarding your next release and the minimum requirements.
I currently use PHP 5.2.17

Replacing "rename" with "rename_winsafe" still produces an error:
"rename_winsafe: This is a dev function not ready for use."

That said your min requirement of PHP 5.2.4 may not be enough.

I got around this issue with this modification:
if (!@rename($tempFilepath, $filepath)) { // added @ to suppress the error
if(!copy($tempFilepath,$filepath)){
die("Error copying $tempFilepath to $filepath: $php_errormsg");
}
unlink($tempFilepath);

};


Maybe this will help others with a slightly out-of-date version of php.
Glen







http://www.CanadianDomainRegistry.ca







ITI Internetworking Technologies Inc.

Re: [ITI] Strict and Rename errors installing CMSB 2.17

By Dave - November 28, 2012

Hi Glen,

Thanks for the post. I can send you a beta of 2.50 as well if you'd like to try that. PHP 5.2.17 is newer than 5.2.4 so you should be fine. I'll email you direct. Thanks
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Strict and Rename errors installing CMSB 2.17

By ITI - November 28, 2012

Thanks Dave

I'm already on your list for beta testers and have the link to download 2.50 so there is no need to email it to me.

I will have a look when I have a bit more time.
Glen







http://www.CanadianDomainRegistry.ca







ITI Internetworking Technologies Inc.

Re: [ITI] Strict and Rename errors installing CMSB 2.17

By Dave - November 28, 2012

No worries. I just emailed you a zip of the latest beta with your suggested www. settings file fix and a rename_winsafe fix. Let me know any feedback (over email).

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [ITI] Strict and Rename errors installing CMSB 2.17

Hello,

I am trying to install cmsBuilder 2.50 on centOS 6 and I am receiving the following error, which seems to be related to this thread:

rename_winsafe: rename return value not boolean true or false!

Could someone please give me a hand resolving this?

Thank you,

Greg

Re: [ITI] Strict and Rename errors installing CMSB 2.17

By Dave - December 20, 2012

Hi Greg,  

I think I see what the error might be, can you edit /lib/common.php, search for: not boolean

And replace this

die(__FUNCTION__. ": rename return value not boolean true or false!"); 

With this:

return $result; 

Let me know if that fixes it for you or if you have any other issues.  Thanks!

Dave Edis - Senior Developer
interactivetools.com

Re: [ITI] Strict and Rename errors installing CMSB 2.17

Hi Dave,

My hosting company actually helped fix this for me. They told me to run the following command on my server, which then allowed me to run the installation wizard:

chown -R apache.apache /var/www/html/cmsAdmin

I am not sure what that does but it certainly fixed the problem!


Thanks,

Greg