garrett9 / app-ignition-laradock

MIT License
6 stars 5 forks source link

error when create project #16

Closed diorz38 closed 5 months ago

diorz38 commented 8 months ago

Description:

error when create project, with following container: apache, Mailhog, Mysql, Php Worker, PHP Myadmin, Redis, Selenium

PHP version: 8.2 Node version: 18

rest was default

Expected Behavior (If Applicable):

Current Version of AppIgnition

1.10.3

Current Version of Docker

Docker Desktop 4.27.2 (137060)

error:

#176 CANCELED

------
 > [php-worker 20/29] RUN if [ true = true ]; then   if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then   printf "\n" | pecl install -o -f redis-4.3.0;   else   printf "\n" | pecl install -o -f redis;   fi;   rm -rf /tmp/pear;   docker-php-ext-enable redis   ;fi:

5.474 usage: /usr/local/bin/docker-php-ext-enable [options] module-name [module-name ...]
5.474    ie: /usr/local/bin/docker-php-ext-enable gd mysqli
5.474        /usr/local/bin/docker-php-ext-enable pdo pdo_mysql
5.474        /usr/local/bin/docker-php-ext-enable --ini-name 0-apc.ini apcu apc
5.474 
5.474 Possible values for module-name:
5.481 bcmath.so gmp.so gnupg.so mbstring.so mysqli.so opcache.so pcntl.so pdo.so pdo_mysql.so pdo_pgsql.so sodium.so xml.so
5.481 
5.481 Some of the above modules are already compiled into PHP; please check
5.481 the output of "php -i" to see which modules are already loaded.
------

failed to solve: process "/bin/sh -c if [ ${INSTALL_REDIS} = true ]; then   if [ $(php -r \"echo PHP_MAJOR_VERSION;\") = \"5\" ]; then   printf \"\\n\" | pecl install -o -f redis-4.3.0;   else   printf \"\\n\" | pecl install -o -f redis;   fi;   rm -rf /tmp/pear;   docker-php-ext-enable redis   ;fi" did not complete successfully: exit code: 1

An error has occured. Read the most recent logs to determine the cause.

This error has automatically been reported. If you feel that you have resolved the issue, please try reinstalling.

what did i do wrong?

diorz38 commented 8 months ago

i can manage to get through and get the project running, by updating the docker to the latest, but when i go to php Myadmin, i got error:

Access Denied!!
MySQL said: 
Cannot connect: invalid settings.
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'172.20.0.4' (using password: YES)
garrett9 commented 8 months ago

@diorz38 Thanks for the information! I have seen this error before, and it could be caused by a couple of things. I'll list them out here, and you can see if any of these fit your scenario:

  1. This could happen if the MySQL container is not running. However, if you managed to get through the installation, I doubt this is the issue.
  2. This could happen if you modified the root password in your MySQL container to something other than root AFTER you've already built the container. The reason for this is because once the MySQL container mounts the data directory associated to it, it will create the root user with the initially set root password. If you change it after the fact, nothing changes. Therefore, as a resolution, you can change the root password back to root.

Let me know if either of these fixed it!

raikS commented 8 months ago

The problem is persistent and I am out of ideas how to fix it. image

@garrett9 neither of the scenarios wont help. Currently the biggest issue is how to pass new setup values to phpMyAdmin. Native var/www/config.inc.php is ignored when renamed. In etc/phpmyadmin/config.inc.php there is a block:

if (isset($_ENV['PMA_USER'])) { $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = $_ENV['PMA_USER']; $cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';}

If I set those values /var/www/projectName/.app-ignition/config.json and restart the service nothing changes. "phpmyadmin": { "PMA_HOST": "mysql", "PMA_PORT": 8081, "PMA_MAX_EXECUTION_TIME": 600, "PMA_MEMORY_LIMIT": "256M", "PMA_UPLOAD_LIMIT": "2G", "PMA_USER": "test", "PMA_PASSWORD": "test" }

garrett9 commented 8 months ago

@raikS Sorry about the troubles :disappointed:

I just want to confirm you're connecting to a MySQL container started by AppIgnition? If not, then you have to specify the host in the UI when configuring PHPMyAdmin your container's host:

image

However, if you do this, make sure your PHPMyAdmin container can connect to your MySQL container's network.

As a last resort, the method for modifying the PHPMyAdmin settings is to do so in the .env file within the app-ignition-laradock directory. Here's what the PHPMyAdmin configuration looks like in the docker-compose.yml file:

### phpMyAdmin ###########################################
    phpmyadmin:
      build: ./phpmyadmin
      environment:
        - PMA_USER=root
        - PMA_HOST=${PMA_HOST}
        - PMA_PASSWORD=${PMA_ROOT_PASSWORD}
        - PMA_ARBITRARY=1
        - MYSQL_USER=${PMA_USER}
        - MYSQL_PASSWORD=${PMA_PASSWORD}
        - MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
        - MAX_EXECUTION_TIME=${PMA_MAX_EXECUTION_TIME}
        - MEMORY_LIMIT=${PMA_MEMORY_LIMIT}
        - UPLOAD_LIMIT=${PMA_UPLOAD_LIMIT}
      ports:
        - "${PMA_PORT}:80"
      networks:
        - frontend
        - backend
raikS commented 8 months ago

Hi! I got to this result following this tutorial. https://www.youtube.com/watch?v=Lq2h_9bMsDU Laravel version 9. CI - none. Larvael plugins: Horizon, Larastan, Pint, Scout, Sentry, Telescope.

Containers: Apache Mailhog MySQL PHP Worker PHP MyAdmin Redis Selenium

Workspace: PHP. 8.2 Composer 2 Node 18 Volume Flag :delegated HMR - 5173 XDebug

I did 2 installations and both times the result was same. Rest is working like it should. In Laravel I can run migrations and seeders, on command line I can access MySql. Currently I have done too much work to play around with this stack. I will try to go through the tutorial in another machine later this week.

Also keep up with the good work. Right now definitely best option to get decent stack up and running quickly.

garrett9 commented 5 months ago

@raikS Sorry for not getting back to this for a while, but I managed to replicate it after wrapping up some other things. I pushed a change and the new version should be available in Docker. Thank you again for bringing this to me!