unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING

unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING

samuelsolischsamuelsolisch Posts: 5Questions: 1Answers: 0

I've installed Editor-PHP-1.7.0 on my server, but I got a error running every editor example. I'm using 5.6.32 PHP version.

The link is :

http://safe-systems.net/digi-access/Editor-1.7.0/examples/simple/simple.html

In the browser network inspector I found a 500 error

I've check a server log and a got this error message:

PHP Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home1/safesys1/public_html/digi-access/Editor-1.7.0/examples/php/staff.php on line 12

Before this installation I installed on XAMPP in my laptop running editor examples without a problem. I using same PHP version as 5.6.32 used in my hosting server.

I'll appreciate your help

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    So what is line 12 of staff.php?

  • samuelsolischsamuelsolisch Posts: 5Questions: 1Answers: 0

    01 . <?php
    02 .
    03 . /*
    04 . * Example PHP implementation used for the index.html example
    05 . */
    06 .
    07 . // DataTables PHP library
    08 . include( "../../php/DataTables.php" );
    09 .
    10 . // Alias Editor classes so they are easy to use
    11 . use
    12 . DataTables\Editor,

  • allanallan Posts: 63,457Questions: 1Answers: 10,465 Site admin
    Answer ✓

    It sounds very much like the web server is actually running PHP 5.2 or older. The use statement for namespaces was introduced in 5.3 and older versions throw the error you noted above when they encounter that code.

    It would be worth creating a phpinfo() file on your server as that will tell you the exact version being used.

    Regards,
    Allan

  • samuelsolischsamuelsolisch Posts: 5Questions: 1Answers: 0

    Allan

    You're right, although php version that shows using phpinfo () was 5.6.32. So, to be sure about php version, I wrote the following directive in .htaccess

    Application AddHandler / x-httpd-php56 .php

    And so, the problem was solved

    Thanks for your help

This discussion has been closed.