The HTTP 400 error when sorting in phpMyAdmin happens because the web server (Lighttpd) blocks URLs that contain encoded line-feed characters (%0A) in the `sql_query` parameter. This is a security check that causes phpMyAdmin requests to be rejected.
To fix it, open your Lighttpd configuration file and add this line to allow phpMyAdmin URLs:
$HTTP["url"] =~ "^/phpmyadmin/" { server.http-parseopts += ( "url-ctrls-reject" => "disable" ) }
Then save the file and restart Lighttpd:
systemctl restart lighttpd
After that, phpMyAdmin will be able to sort columns again without returning the 400 error.
If you only use it for local testing, this change is safe.
For production environments, it’s better to keep this limited to phpMyAdmin instead of applying it globally.