PHP Parse error: in helpers.php (line 23) after switch from php 5.6 to 7

Ich bekomme folgenden Fehler nach dem Umstellen von php 5.6 auf php 7…

20.07.2016 11:14:24 * [client * ] PHP Parse error: syntax error, unexpected ‘[’, expecting ‘)’ in /*/htdocs/web/kirby/helpers.php on line 23

in line 23 der helpers.php wird der link zur css datei erstellt. Ein blick in die Datei verrät auch, dass dort eigentlich alles richtig sein müsste. Hat jemand einen tipp?

Viele Grüße und lieben Dank euch! :slight_smile:

Did you make sure that the switch to PHP 7 really worked? It looks like an error I got a couple times for clients, which still ran PHP 5.3.

I just want to make sure it’s really not the same issue again.

Well,

i am hosting the kirby installation on ‘strato’ ( :frowning: ). There i have the option to just switch from PHP 5.6 to 7.0.
After switching to 7.0 i get a blank screen. When checking the log file, i discovered that this error occurres with every page call…

Html looks like this:

<html>
  <head>
    <style>.container > .infoBoxList > .shareInfoBox{display:none !important;}</style>
  </head>
  <body>
 </body>
</html>`

No JS, PHP errors what so ever… /panel is also blank.

PHP 5.6 works as expected

Edit: OMG, i didn’t even notice that i was writing this in german… i am really sorry, the heat is killing me softly…

Edit:.

It seems like the php version is not correct, even though i don’t know why… when i switch the version from 5.6 to 7, the php version is displayed as:

Current PHP version: 5.3.29

Then that’s the issue. Kirby no longer supports PHP 5.3. Please contact the hosting provider (or switch, they are awful…).

i know… client wants strato …

found the error btw. if anyone else encounters it…

…even though the domain’s AA and AAA records point to the right directory htdocs/web/ a .htaccess generated by strato and placed in the htdocs prevented the switch from php version 5 to 7.

Deleting the .htaccess solved the problem for me. I have my own .htaccess in the /web/ dir where the root of my homepage is specified.

Thanks for your help on such a shiny day!
Enjoy :slight_smile:

1 Like

I ran into something very similar with 1und1 recently. They have the same weird htaccess stuff going on there. German shared hosting… :slight_smile:

Maybe that’s because Strato was founded by a former 1&1 manager. We don’t know. :wink:

you know way too much about them :stuck_out_tongue:

Wikipedia does. I actually thought that they were owned by the same company, but they aren’t. :slight_smile:

Hi guys,

I’m running into the same issue unfortunately. :frowning:
PHP version is 7.0.9. Deleting the .htaccess didn’t help.
I’m also not with Strato or 1&1. :wink:

Hope you can help me out :slightly_smiling_face:

Cheers

Have you verified your php version with phpinfo()?

Returns 5.3.29 :poop: What now?

Is this the htaccess you deleted? Something is preventing you from going to PHP 7

Then obviously there is something preventing the switch to 7.0.9. Is there an .htaccess in the webroot that tells the server to use the old version? Do not delete the .htaccess in the kirby folder!

Ha, I actually deleted that one. But I re-uploaded it and it still doesn’t work. I think it’s the only .htaccess file on that server (in the kirby folder for sure), at least I couldn’t find any other.

Do you host Kirby in the root folder or in a subfolder? Have you looked in the webroot, if Kirby is not in the webroot? Otherwise, I’d contact the provider. Who is your provider? Maybe we can find help on the internet.

I host it in the subfolder. In the webroot, there’s no .htaccess. It might be on a deeper level, but I can’t access it.
My provider is variomedia. :slight_smile:

https://www.variomedia.de/faq/Wie-kann-ich-eine-bestimmte-PHP-Version-auswaehlen/article/193

It seems that you have to add the php version to the .htaccess

AddHandler application/x-httpd-php70 .php

Awesome, that was it. Thank you so much :slight_smile:

1 Like