Dockerfile icon indicating copy to clipboard operation
Dockerfile copied to clipboard

PDO corruption in php-nginx-dev:8.1-* images on Mac

Open dersonsena opened this issue 2 years ago • 3 comments

I'm using a MacBook Air M1 Ventura (13.3.1) that requires an ARM64 architecture for almost everything.

I spent some time trying to understand why a simple connection with the PDO was not working:

$pdo = new PDO('mysql:host=xxxx;dbname=xxxx', 'root', 'secret', [
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
]);

I had the xdebug activated and yet no errors or warnings appears in the logs, NGINX simply returned a 502 error:

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.22.0</center>
</body>
</html>

The solution I found was upgrade to version 8.2 of this same package, but I believe version 8.1 is still widely used. I found it important to register this problem for the community to be able to solve it =)

dersonsena avatar May 07 '23 20:05 dersonsena

Same Issue using webdevops/php-nginx-dev:8.0 image

Petrucheqa avatar Jun 29 '23 09:06 Petrucheqa

I've spent three days looking for complicated solutions. I've found that the error comes from my docker configuration 😭

If x86 option is checked just uncheck it.

Capture d’écran 2023-07-04 à 14 36 33

Petrucheqa avatar Jul 04 '23 12:07 Petrucheqa

Thx this has been helpful for me !

Blomster1 avatar Nov 30 '23 19:11 Blomster1