Skip to content

Error when I ran docker-compose up #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mraghbeerasi opened this issue Jan 28, 2023 · 2 comments
Open

Error when I ran docker-compose up #1

mraghbeerasi opened this issue Jan 28, 2023 · 2 comments

Comments

@mraghbeerasi
Copy link

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

@agt2020
Copy link

agt2020 commented Jun 5, 2023

same me

@croman10
Copy link

croman10 commented Dec 5, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants