Error when I ran docker-compose up
I received the following error when I ran docker-compose up. Can you share your thoughts:
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /var/www/html/index.php:3 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 3
same me
Hi, so I figured it out!
1st: Go to the Docker desktop application and click on the specific Apache service or image you used for your project (in my case, I used PHP:8.3.0-apache) 2nd: Right-click on the three vertical dots on Actions and click on Open in Terminal 3rd: Run this command docker-php-ext-install mysqli in that terminal (this will install my SQL package needed) 4th: Return to Docker Desktop and restart that specific container, and that should work!
PS: The only issue I found is that when I run the docker-compose-up command, I must complete this whole process again for my site to run. In other words, the mysqli packages do not save. I am testing on my end, but please share if anyone knows another way!
Look at Vincent Stevenson's tutorial on YouTube; this is where I found the solution!