Parse error: syntax error, unexpected '['

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Parse error: syntax error, unexpected '['

Post by rbaby »

Parse error: syntax error, unexpected '[' in /nfs/c01/h07/mnt/9546/domains/domain.com/html/index.php on line 134

The dev site was working fine, then no one touched it for a few days. When we returned after the weekend, we see the following error and cannot access the front or back-end of the site. We checked index.php on the indicated line and nothing seems to be amiss.

Has anyone seen this issue before? What typically causes it? We didn't change anything, not even content.

This is the latest version of CMSMS, relatively new install. CGBlog, LISE and Sitemap Manager installed. There are a few articles, some content pages, sitemaps and templates.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1619
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Parse error: syntax error, unexpected '['

Post by DIGI3 »

Any chance someone changed the PHP version?
Not getting the answer you need? CMSMS support options
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: Parse error: syntax error, unexpected '['

Post by rbaby »

DIGI3 wrote:Any chance someone changed the PHP version?
Thank you for your time, DIGI. Not that I know of, would anyone other than me be able to change PHP but maybe the host did without my knowledge. It was set to 5.6.21 but now I changed it to PHP 7. I get a different error, now:

Warning: count(): Parameter must be an array or an object that implements Countable in /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php on line 751
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1619
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Parse error: syntax error, unexpected '['

Post by DIGI3 »

That's just a warning, you can ignore that until the next version of LISE is released. Sounds like your PHP version got changed then, if that fixed the main problem (note that if you have some of CG's latest modules, you'll need PHP 7.2)
Not getting the answer you need? CMSMS support options
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: Parse error: syntax error, unexpected '['

Post by rbaby »

DIGI3 wrote:That's just a warning, you can ignore that until the next version of LISE is released. Sounds like your PHP version got changed then, if that fixed the main problem (note that if you have some of CG's latest modules, you'll need PHP 7.2)
Thanks again DIGI, it's v7.2.12. I wish I could ignore it, but it's not rendering anything at all. Front end looks like:
Screen Shot 2019-05-21 at 5.42.07 PM.png
/admin looks like:
Screen Shot 2019-05-21 at 5.43.51 PM.png
when I go to /admin/login.php, it renders the login with errors:
Screen Shot 2019-05-21 at 5.47.15 PM.png
When I log in, I just get a white page with error lines:

Code: Select all

Warning: count(): Parameter must be an array or an object that implements Countable in /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php on line 751

Warning: count(): Parameter must be an array or an object that implements Countable in /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php on line 751

Warning: count(): Parameter must be an array or an object that implements Countable in /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php on line 751

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php:751) in /nfs/c01/h07/mnt/9546/domains/domain.com/html/lib/classes/class.cms_cookies.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php:751) in /nfs/c01/h07/mnt/9546/domains/domain.com/html/lib/classes/class.cms_cookies.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php:751) in /nfs/c01/h07/mnt/9546/domains/domain.com/html/lib/classes/class.cms_cookies.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php:751) in /nfs/c01/h07/mnt/9546/domains/domain.com/html/lib/classes/class.cms_cookies.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c01/h07/mnt/9546/domains/domain.com/html/modules/LISE/LISE.module.php:751) in /nfs/c01/h07/mnt/9546/domains/domain.com/html/lib/classes/class.cms_cookies.php on line 106
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1619
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Parse error: syntax error, unexpected '['

Post by DIGI3 »

You may need to clear the site cache after switching PHP versions. You should probably also set display_errors to 0 in your php setup and just have them go to log.

Clear the cache by removing everything in tmp/cache and tmp/templates_c

Usually warnings don't result in a white screen, but if you still get one in admin after clearing the cache, go to /modules and rename the LISE folder temporarily. If admin works after that, you'll at least know where to focus your efforts. You'll need to comment out any LISE calls in your pages/templates to get the frontend to work.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “CMSMS Core”