geerlingguy / drupal-container

Drupal container for running Drupal sites with Docker, built with Ansible.
https://hub.docker.com/r/geerlingguy/drupal/
44 stars 27 forks source link

ARM is running with PHP 7.3, but MySQL PDO extension is built for PHP 7.2 #21

Closed neural-loop closed 5 years ago

neural-loop commented 5 years ago

Can dig up the logs if additional information is needed. Was getting "The website encountered an unexpected error. Please try again later." when visiting cluster.pidramble.test.

It was a mysql connection error message - googling said to install php-mysql, and I saw that it was installed for php7.2 https://github.com/geerlingguy/drupal-container/blob/796f747633ab8f0443618cfc2f5389a77fda1caa/arm32v7/Dockerfile#L14 . Checked the running version of php and it was on 7.3 within the docker container. (logged into docker and put phpinfo in root folder)

Tried to a2dimod php7.3 / a2enmod php7.2, except there wasn't a php7.2 apache module available.

geerlingguy commented 5 years ago

Hmm... yeah, I'm seeing this now on a rebuilt Pi:

Error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in Drupal\Core\Database\Driver\mysql\Connection::open() (line 405 of /var/www/html/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php).

I'll check into it.

geerlingguy commented 5 years ago

Upstream issue: https://github.com/geerlingguy/php-apache-container/issues/10

Testing builds now.

geerlingguy commented 5 years ago

php-apache container is now running on Buster, but that doesn't solve for the ARM version, which is built a bit differently. I'm testing that build still (takes forever on my Mac :P).

geerlingguy commented 5 years ago

Just pushed a new ARM version, testing on my Pi 4 now.

geerlingguy commented 5 years ago

Hmm, now when the entrypoint doesn't see Drupal and tries downloading it, the Docker logs show:

Downloading Drupal...
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
geerlingguy commented 5 years ago

For now, my solution is to add a variable DRUPAL_DOWNLOAD_VERIFY_CERT that passes the -k option to the curl download from https://www.drupal.org/.

It's using a GlobalSign cert, and I have the root for it in the image in /etc/ssl/certs... but it's not matching it up even when passing the cert explicitly, so something may be funky with Fastly or something. Curl validates just fine locally and in another test Docker container, and on a Pi 4 running Debian Buster itself. So not sure what's up besides maybe some weird networking issue.

For now, not a big deal as this download is only used for demo purposes anyways, and the default is to still validate the cert.

geerlingguy commented 5 years ago

Yay, got it working again, all on PHP 7.3 now.

Screen Shot 2019-07-10 at 9 18 14 PM
neural-loop commented 5 years ago

Nice work!

On Wed, Jul 10, 2019, 7:19 PM Jeff Geerling notifications@github.com wrote:

Yay, got it working again, all on PHP 7.3 now.

[image: Screen Shot 2019-07-10 at 9 18 14 PM] https://user-images.githubusercontent.com/481677/61017293-41543d00-a358-11e9-90b8-b8c26729e6e3.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/geerlingguy/drupal-container/issues/21?email_source=notifications&email_token=AAE75EKAV5IPNAEJMVC3CVLP62KELA5CNFSM4HY6Z6C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZVJKJI#issuecomment-510301477, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE75EIXU5P3KT5MJZV2MJ3P62KELANCNFSM4HY6Z6CQ .