How to create a docker-based LAMP stack using docker-compose on Ubuntu 18.04 Bionic Beaver Linux - LinuxConfig.org


#1

In this tutorial, we will see how to create a LAMP stack based on dockerized components: following the "one service per container" philosophy, we will assemble the environment using docker-compose, a tool to orchestrate container compositions.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-create-a-docker-based-lamp-stack-using-docker-compose-on-ubuntu-18-04-bionic-beaver-linux

#2

SMaction

Hi,

I followed the instructions and modified your files for my own use. However, I am getting an error that pdo is not installed when I go to use a database connection. My docker-compose file is posted here as well as my Dockerfile:https://pastebin.com/t26mT4YK and https://pastebin.com/0RrDprbt

TIA


#3

Dehan Louw

Great write-up, thanks! I just keep getting the error:
Uncaught Error: Class ‘mysqli’ not found in /var/www/html/events.php:6

Any idea? Everything is exactly like you said


#4

Egidio Docile -> Dehan Louw

You are using mysqli extension. This is not included in the default php dockerfile: to include it, it’s necessary to create a custom dockerfile we the needed instructions. I’m going to update the article to include those. Thank you for your attention.