ZenphotoCMS Forum
unexpected '[' in functions.php - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: unexpected '[' in functions.php (/thread-12784.html)



unexpected '[' in functions.php - komradebob - 2015-07-09

I'm trying to install zenphoto.

Downloaded (2x), unzip/tar'd to a subdir on the web server, browse to http://myserver.com/zenphoto and am rewarded with a blank screen.

Logfile shows:
[Thu Jul 09 14:30:26 2015] [error] [client ] PHP Parse error: syntax error, unexpected '[' in /export/sites/www..com/web/zenphoto/zp-core/functions.php on line 291

Any ideas?




unexpected '[' in functions.php - acrylian - 2015-07-09

That line reads $fields = []; which is actually PHP 5.4+ syntax. So either you upgrade your server or you change that line to $fields = array(); (We normally don't recommend to change core files so this is a quick fix with caution).

Apparently someone forgot sometime that we actually support PHP 5.2+…




unexpected '[' in functions.php - acrylian - 2015-07-11

Please try the support build as it has been corrected there.