PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client [duplicate]

This question already has answers here: php mysqli_connect: authentication method unknown to the client [caching_sha2_password] (15 answers) Closed 2 years ago. I’m running MySQL version 8 on PHP 7.0. I’m getting the following error when I try to connect to my database from PHP: Connect Error: SQLSTATE[HY000] [2054] The server requested authentication method unknown to … Read more

How to require a fork with composer?

This is my composer.json, I want to use Nodge’s fork of lessphp project on Github “repositories”: [{ “type”: “package”, “package”: { “version”: “dev-master”, “name”: “nodge/lessphp”, “source”: { “url”: “https://github.com/Nodge/lessphp.git”, “type”: “git”, “reference”: “master” }, “autoload”: { “classmap”: [“lessc.inc.php”] } } }], “require”: { “php”: “>=5.3.3”, “nodge/lessphp”: “dev-master” }, But I get this error when I … Read more

json_encode() escaping forward slashes

I’m pulling JSON from Instagram: $instagrams = json_decode($response)->data; Then parsing variables into a PHP array to restructure the data, then re-encoding and caching the file: file_put_contents($cache,json_encode($results)); When I open the cache file all my forward slashes “https://stackoverflow.com/” are being escaped: http:\/\/distilleryimage4.instagram.com\/410e7… I gather from my searches that json_encode() automatically does this…is there a way to … Read more