Laravel PlanetScale Issue "PDO::__construct(): open_basedir restriction in effect. File(/etc/ssl/cert.pem) is not within the allowed path(s): (/var/www/html:/dev/stdout:/tmp)"

ahhh a bug! I just updated the base container used for Laravel apps.

okay, a few things:

  1. The ssl path now should be /etc/ssl/certs/ca-certificates.crt (previous file path was for Alpjne base containers but newest ones are based on Ubuntu
  2. It looks like the new containers have some open base dir config in place that needs to be changed. This file specifically (assuming php 8.1) docker-php/y-override-php-defaults.conf at dd6968f388c765136825f39d397a6c4abc234521 · serversideup/docker-php · GitHub

That file, within the container, is at /etc/php/8.1/fpm/pool.d/y-override-php-defaults.conf

That might be most easily edited with a sed find and replace command within the Dockerfile.

On my end i’ll open a PR to the base containers and can update our launcher so it takes care of that.

1 Like