Parse Error in Production and Not Local Server |
Hello. I'm new to the forum but not new to CI. Been a user since CI3. I just downloaded a fresh copy of CI and developed a starter site in WAMP. All was working great; pushed it over to production server and it wont load. The server error log says:
Error Log Excerpt Code: [12-Oct-2021 14:45:24 America/Chicago] PHP Parse error: syntax error, unexpected ':', expecting '{' in /mysite/system/Common.php on line 44 System/Common.php Excerpt Code: if (! function_exists('app_timezone')) { Just as the CI user's guide says, I did not modify any sys files. Anyone run into the same issue? I researched a bit but never found anything. Any/all help on this would be greatly appreciated. [/code]
What version of PHP? CI4 require PHP 7.3
http://codeigniter.com/user_guide/intro/...ments.html
Thanks for asking. I forgot to mention the server php version.
Localhost: 7.3.21 production: 7.4 I think i'll retrograde my production server to see if that fixes it. but CI4 says 7.3 or younger. update: retrograde to 7.3 on production worked. should I report this to the devs so they can look into a 7.4 fix?
Dev here. That's weird, return types were introduced in PHP 7 so it being at 7.4 doesn't matter.
I'm running on php 8.0.11 and never seen a problem like that.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I just switched my localhost server to php7.4.9 and cycled through the site; no issues. I'll upgrade the production site back to 7.4 this weekend and see if the bug remains or was a fluke.
|
Welcome Guest, Not a member yet? Register Sign In |