Skip to content

Error when I ran docker-compose up #1

Open

Description

@mraghbeerasi

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

Activity

  1. agt2020 commented on Jun 5, 2023

    @agt2020

    same me

  2. croman10 commented on Dec 5, 2023

    @croman10

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions