Coder Social home page Coder Social logo

Comments (12)

n1crack avatar n1crack commented on September 17, 2024 1

removed dependency of symfony, can you update the library and test it ?

from datatables.

n1crack avatar n1crack commented on September 17, 2024

Seems something that related to :
https://www.w3.org/International/questions/qa-byte-order-mark.en#problems

You can try saving the files without BOM (remove bom)
https://www.w3.org/International/questions/qa-byte-order-mark.en#remove

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

I recreated the files on my namecheap shared hosting (php 5.6) via cpanel and copy pasted my code.
I am getting different error this time

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/crafctuz/ossamarafique.com/datatable/vendor/ozdemir/datatables/src/Datatables.php on line 68

Please review it here :
https://www.ossamarafique.com/datatable/index.php
https://www.ossamarafique.com/datatable/ajax.php

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

After changing php version to 7.3 error is changed
Fatal error: Uncaught PDOException: could not find driver in /home/crafctuz/ossamarafique.com/datatable/vendor/ozdemir/datatables/src/DB/MySQL.php:45 Stack trace: #0 /home/crafctuz/ossamarafique.com/datatable/vendor/ozdemir/datatables/src/DB/MySQL.php(45): PDO->__construct('mysql:host=loca...', 'crafctuz_test', 'crafctuz_test') #1 /home/crafctuz/ossamarafique.com/datatable/vendor/ozdemir/datatables/src/Datatables.php(59): Ozdemir\Datatables\DB\MySQL->connect() #2 /home/crafctuz/ossamarafique.com/datatable/ajax.php(29): Ozdemir\Datatables\Datatables->__construct(Object(Ozdemir\Datatables\DB\MySQL)) #3 {main} thrown in /home/crafctuz/ossamarafique.com/datatable/vendor/ozdemir/datatables/src/DB/MySQL.php on line 45

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

Now after changing PHP version to 7.1 Errors are gone but the same problem again

{"draw":0,"recordsTotal":2,"recordsFiltered":2,"data":[["1","admin"],["2","user"]]}HTTP/1.0 200 OK
Cache-Control: no-cache, private
Content-Type:  application/json
Date:          Fri, 11 Jan 2019 15:16:40 GMT

{"draw":0,"recordsTotal":2,"recordsFiltered":2,"data":[["1","admin"],["2","user"]]}

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

Now, PHP version is 7.3 and I enabled pdo_mysql.
Problem is same, it is showing the headers.
https://www.ossamarafique.com/datatable/ajax.php

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

This problem looks similar to
https://stackoverflow.com/questions/14405916/displaying-cache-headers
https://stackoverflow.com/questions/20075235/symfony-ajax-response-but-with-headers-http-1-0-200-ok-cache-control-no-cache

from datatables.

n1crack avatar n1crack commented on September 17, 2024

Couldn't reproduce the error. Sorry.

Can you try

echo json_encode( $dt->generate()->toArray() );

from datatables.

n1crack avatar n1crack commented on September 17, 2024

I think this is something related to webserver settings
Can you check nginx setup or .htaccess file if you are using apache.

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

I already used above thing, But the default method was not working that's why I opened the issue.
My .htaccess code ::

#turn on url rewriting 
RewriteEngine on
#remove the need for .php extention 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php
ErrorDocument 404 /404-error.php
ErrorDocument 403 /assets/pages/403.php

But it has nothing to do with that header output.

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

This error is showing on my both local server and NameCheap shared hosting.

from datatables.

OssamaRafique avatar OssamaRafique commented on September 17, 2024

Its working now, Thank you! 👍

from datatables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.