Htmlaw.php ?

Htmlaw.php ?

matolamatola Posts: 23Questions: 6Answers: 1
edited May 2017 in Editor

Hi,

My code works nicelyon my local server, but when I put it on remote production server I get the following message as response to XHR:
<b>Parse error</b>: syntax error, unexpected '[' in <b>/home/d37109/public_html/LAGVERKTYG/php/lib/Vendor/Htmlaw.php</b> on line <b>39</b>

The remote protocol is https.

What would be the cause for that? Please advice.

Debug: ujopiv

Best Regards,
M

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin
    Answer ✓

    What version of PHP is your remote server using? Is it the same as your local server?

    My guess is that, from the error, the remote server is using PHP 5.3 and doesn't like the [] array shorthand that was introduced in 5.4. Given how old and out of support 5.3 is, it would be worth upgrading your PHP.

    Is that the version of Htmlaw that comes with Editor?

    Allan

  • matolamatola Posts: 23Questions: 6Answers: 1

    Thanks for your quick answer, Allan.

    I run 5.5.12. The production server runs 5.3.29.
    And yes, the version of Htmlaw comes with Editor.
    I will contact the server people.

    / M

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Could you show me what is on line 39 in the Vendor/Htmlaw.php file? In the current release of Editor it is an empty line.

    What version of Editor are you using? And are you using the PHP libraries that came with that version?

    Allan

  • matolamatola Posts: 23Questions: 6Answers: 1
    Answer ✓

    Thank you for pointing me in this direction.

    Without yet getting our webhost to upgrade their php version, I was able to solve the problem by replacing the Htmlaw.php that uses the new way of defining an array. It seems to work fine now.

    The old Htmlaw.php line 39 is:
    public static $defaultConfig = [

    Eric

This discussion has been closed.