always the same error
always the same error

hi everyone
I used the editor to generate a datatable. it works fine online but on my local server I have the same error for each datatable I used Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
I have searched for the solution but I don't know what is the problem.
I am on debian 9 apache 2 mariadb php7
here are the response when I follow the explications of the page tn1
Parse error: syntax error, unexpected '$this' (T_VARIABLE), expecting ',' or ';' in /var/www/html/******/php/lib/Database.php on line 63
but I don't see where is the problem
Thanks
ps I am from france so I apologize for my english
Replies
Hi @stephane59 ,
Is
/var/www/html/******/php/lib/Database.php
your script, or one from the Editor distribution? Could you paste the file here if it's yours?Cheers,
Colin
hi here is the code from editor
second part
};
I don't see the error there either I'm afraid. Is that the only thing that is bring returned from the server?
Can you show me your
config.php
file please?Allan
of course
<?php if (!defined('DATATABLES')) exit(); // Ensure being used in DataTables env.
/*
* DB connection script for Editor
* Created by http://editor.datatables.net/generator
*/
// Enable error reporting for debugging (remove for production)
error_reporting(E_ALL);
ini_set('display_errors', '1');
/*
* Edit the following with your database connection options
*/
$sql_details = array(
"type" => "Mysql",
"user" => "",
"pass" => "",
"host" => "localhost",
"port" => "",
"db" => "gravure",
"dsn" => "charset=utf8"
);
I delete the user and password
Thank you - I'm genuinely at a loss with this one. That line should be absolutely fine with PHP7.
What is the exact version that your server is running (
phpinfo()
will show you)?Are there any other errors shown in the return, or in the server's error log?
Thanks,
Allan
here my version
7.0.33-0+deb9u3
and thanks for the time trying to help me
Are you able to upgrade to PHP 7.3? I'm honestly not sure it will fix the issue, but at the moment I'm out of ideas.
One other thing, could you dropbox (or whatever) the Database.php file to me please? I'm wondering if there is a hidden character causing issues.
Allan
http://dl.free.fr/sCYipyEmm
here the link to datatable.php, database.php and config.php
stef
Nope - doesn't look like its a hidden character. To be sure you could grab the latest Database.php file from here.
Did you try upgrading your PHP?
Allan
yes always the same I will try the file