The Estuary Shop Posted December 7, 2016 Share Posted December 7, 2016 I was originally trying to edit my store and was unable. I noticed I needed to upgrade. Installed the latest upgrade unable to access website or admin site. I don't think it completed the process. I receive the error below. Parse error: syntax error, unexpected T_FUNCTION in /home4/jnevada/public_html/shop/classes/config.class.php on line 223 My store- www.theestuaryshop.com/shop/ Please HELP! Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 The config.class.php file at line 223 for CC611 does not have a statement that would trigger this error. Using a programmer's text editor, please open your copy of this file for viewing. Copy the code beginning 10 lines above line 223 down to 10 lines after line 223 and paste them into a code box (the <> toolbutton in the above toolbar) so that we might find what PHP is complaining about. Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 thanks for responding. * @param string $data */ public function merge($config_name, $element, $data) { if (!empty($element)) { $this->_temp[$config_name][$element] = $data; $this->_config[$config_name][$element] = $data; } else { if (is_array($data)) { if (isset($this->_temp[$config_name])) { $this->_temp[$config_name] = merge_array($this->_temp[$config_name], $data); I left out the lines after sorry @param string $data */ public function merge($config_name, $element, $data) { if (!empty($element)) { $this->_temp[$config_name][$element] = $data; $this->_config[$config_name][$element] = $data; } else { if (is_array($data)) { if (isset($this->_temp[$config_name])) { $this->_temp[$config_name] = merge_array($this->_temp[$config_name], $data); } else { $this->_temp[$config_name] = $data; } $this->_config[$config_name] = merge_array($this->_config[$config_name], $data); } } } /** * Set a config value * * If no element is set then the entire config is Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 I am not finding any version of CubeCart where those statements are at that line number. I will send you a message and ask that you attach a copy of config.class.php to an email. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 Do a manual upgrade of all files from the 6.1.1 release and then run www.theestuaryshop.com/shop/setup to complete the database changes and this should fix any problems Ian Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 I left out the lines after sorry @param string $data */ public function merge($config_name, $element, $data) { if (!empty($element)) { $this->_temp[$config_name][$element] = $data; $this->_config[$config_name][$element] = $data; } else { if (is_array($data)) { if (isset($this->_temp[$config_name])) { $this->_temp[$config_name] = merge_array($this->_temp[$config_name], $data); } else { $this->_temp[$config_name] = $data; } $this->_config[$config_name] = merge_array($this->_config[$config_name], $data); } } } /** * Set a config value * * If no element is set then the entire config is Where do I complete the manual upgrade? Also where do I run www.theestuaryshop.com/shop/setup? I'm sorry but I don't see those options anywhere. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 You need to use an FTP program or the file manager option within your hosting control panel (cPanel for example) to upload the extracted files from the 6.1.1 zip file. Then you simply enter that URL into your browser. Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 What file am I extracting them too? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 I think I found the problem. Some versions of PHP do not like anonymous functions. Line 223: array_walk_recursive($data, function(&$s,$k){return stripslashes($s);}); as well as 226 has an anonymous function definition. I thought I submitted an issue in the Github about this. What is the exact version of PHP you are running? Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 Where do I find that? Sorry I'm new to cubecart. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 You need to obtain the CubeCart 6.1.1 zip file from CubeCart.com website, save it to your PC, extract all the files from the zip file. Then using a FTP client program or the File Manager option within cPanel upload all these files to your /shop directory and then enter the URL I have already given into your browser to complete the upgrade Ian Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 In CubeCart's admin, the first page shown to you is the Dashboard. The tab that says Store Overview.. Anonymous functions became available in PHP 5.3.0. Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 I cannot access the admin page. I get the same error. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 The Github issue #1236 changed the code to use this anonymous function. Line 223 is this new statement. But, the code you pasted above is not near line 223. Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 Where is line 223? Now I'm confused? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 If you have the /setup/ folder still on your site, have your browser ask for this file: www.theestuaryshop.com/shop/setup/info.php If /setup/ is not on your site, create the following file in your /shop/ folder: Name: info.php Contents: <?php phpinfo(); ?> Then have your browser ask for the file: www.theestuaryshop.com/shop/info.php The chart shown to you will show you the exact version of PHP you have. Line 223 is the array_walk_recursive statement I posted above. Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 PHP Version 5.2.17 So what do I need to do now? Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 PHP 5.2.X was end of life in 2011 !! Even php 5.3, 5.4 and now 5.5 have reached end of life - you need to be on 5.6 or better still php 7 Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 How do I do that? And will this change my store? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2016 Share Posted December 7, 2016 It will not change your store. You may need to get your hosting tech support to update your version of PHP. Or, there may be a setting in your hosting account's control panel to choose what version of PHP you want. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 You may be able to upgrade the version of php yourself within cPanel but your hosting company if not. Unbelievable that any hosting company is making 5.2 still available - it is so insecure ! Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 What version should it be? Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 15 minutes ago, havenswift-hosting said: you need to be on 5.6 or better still php 7 Quote Link to comment Share on other sites More sharing options...
The Estuary Shop Posted December 7, 2016 Author Share Posted December 7, 2016 Ok I have updated it. PHP Version 7.0.12 Now what do I do? Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 7, 2016 Share Posted December 7, 2016 Did you check your store ? You are not getting the error any longer but the store front is closed and you will have a new admin url to login into the backend Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.