[open] PHAR installer upgrade config.php side-effects
Posted: Wed Mar 22, 2017 9:40 am
Summary: The PHAR installer upgrade "resets" previously set 'root_url' and 'ssl_url' $config variable values which results in these variables no longer having their values automatically generated. Downstream effects impact the entire system.
Details:
I've been testing upgrades of 1.12.1 installs using the PHAR installer. After a successful upgrade, I started to debug some of my smarty and module issues. I enabled $config['debug'] and $config['debug_to_log'] in config.php. While testing, I noticed odd entries in debug.log:
Further investigation found that in smarty, the {root_url} tag was also returning an empty string.
So, I looked more closely at config.php and noticed that the PHAR installer had changed the values of my 1.21.1 $config['root_url'] and $config['ssl_url'] variables to empty strings. Not good.
I worked around the issue by calling unset() on these two variables, as I do with other ArrayAccess objects, and that resolved the issue--the automatic value generation magic of cms_config was restored for these variables and no more fsockopen() errors.
This should be reproducible, but if not, let me know if you need more info.
Details:
I've been testing upgrades of 1.12.1 installs using the PHAR installer. After a successful upgrade, I started to debug some of my smarty and module issues. I enabled $config['debug'] and $config['debug_to_log'] in config.php. While testing, I noticed odd entries in debug.log:
and occasionally, at the top of both front-end and Admin console pages, I'd see these errors:exception Could not connect to the async processing action
I did some debugging of CmsJobManager.php and found that, indeed, the hostname used was an empty string (''). Strange.Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/cms2/public_html/modules/CmsJobManager/CmsJobManager.module.php on line 303
Warning: fsockopen(): unable to connect to :80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/cms2/public_html/modules/CmsJobManager/CmsJobManager.module.php on line 303
Further investigation found that in smarty, the {root_url} tag was also returning an empty string.
So, I looked more closely at config.php and noticed that the PHAR installer had changed the values of my 1.21.1 $config['root_url'] and $config['ssl_url'] variables to empty strings. Not good.
I worked around the issue by calling unset() on these two variables, as I do with other ArrayAccess objects, and that resolved the issue--the automatic value generation magic of cms_config was restored for these variables and no more fsockopen() errors.

This should be reproducible, but if not, let me know if you need more info.