Errors In October CMS Installation Via CPanel
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?
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.
- → Laravel Deployment on Shared Hosting - 404 Error
- → October CMS - Cannot edit pages in backend - http status 403
- → Errors in October CMS installation via cPanel
- → run cron job in octobercms cpanel
- → setting up server on bluehost for laravel application and having issue with php -v
- → Installing Laravel 5 on shared cpanel hosting
- → phpMyAdmin - foreign key not working
- → In Laravel 4.2 Running A Select Query using DB::select() throwing Error on cpanel
- → Why page showing content when browse to site.com/file.php/
- → Laravel 5.5 Cron Job proc_open and ArgvInput problems
- → How do I fix issues with "composer dependencies" on a WordPress/Cpanel site?
- → cPanel Email vs. Mail delivery service (Mailgun) vs. Email Server Hosting
- → Wordpress CRON job commands