0
votes

I just installed October CMS on my hosting platform via cPanel's Softaculous utility. I do not believe installation method has anything to do with my errors but mentioning it just in case I am wrong. October CMS Version: 1.0.458 Sever PHP Version: 7.3.3

After installing in the designated directory it is showing "HTTP 500" generic error so I checked the error log. Following error was being shown

"[28-Sep-2019 11:09:04 Etc/GMT] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/XYZ/public_html/XYZ/vendor/october/rain/src/Support/helpers.php on line 149"

There is absolutely no online resource which describes occurance of such an error and possible solution. So I opened the helper.php to look at line 149. The code on this line was,

 $query = str_replace(['%', '?'], ['%%', '%s'], $query);

Now there is nothing seemingly wrong with this line but I thought may be the "str_replace" function is not able to understand the array arguments. So I removed the array arguments and wrote it two times like

 $query = str_replace('%', '%%', $query);
 $query = str_replace('?', '%s', $query);

Now the error on this line disappears but a new error appears on another line as follows

PHP Parse error:  syntax error, unexpected '[' in /home/XYZ/public_html/XYZ/vendor/october/rain/src/Support/helpers.php on line 238

The code on this line is

function trans($id = null, $parameters = [], $domain = 'messages', $locale = null)

Now here I am not sure if removing brackets would make everything alright. Why should such strange errors appears? Can someone help?

1
can you share php version info.Hardik Satasiya

1 Answers

0
votes

Are you 100% sure the PHP version you're using is 7.3.3?

The short array syntax of using [ ... ] instead of array( ... ) was introduced in PHP 5.4 and the errors you are getting are the errors that will happen if you are using an older version of PHP. I'm not sure how cPanel Softaculous works, but perhaps somehow it set you up to use a different version of PHP then you expect.

I would try running phpinfo() to double check your PHP setup.