DockerIt / opencart-docker

Dockerize Opencart
MIT License
34 stars 24 forks source link

Composition are not made an copy of opencart #8

Closed ktfth closed 2 years ago

ktfth commented 4 years ago

I have followed the instruction on the README.md and have not worked, maybe the instructions not work well for made a copy of the opencart on the directory. Can you help me setup the enviroment?

Thanks

matt-t-d commented 4 years ago

There are a few issues with this project so at the moment there are additional steps that might be needed.

What version of OpenCart are you using this on?

ktfth commented 4 years ago

3.0.3.3

matt-t-d commented 4 years ago

I updated this project a couple of days ago, could you try it again?

ktfth commented 4 years ago

Worked, until the mysql connection:

Failed to connect to database. Reason: 'SQLSTATE[HY000] [2002] No such file or directory'

matt-t-d commented 4 years ago

The mysql host is probably wrong. It should be mysql not localhost.

If not, check that the mysql container is running correctly (docker ps). It can fail to start if the port is already in use.

ktfth commented 4 years ago

909c03239d0e opencart-docker_apache "/opt/docker/bin/ent…" 6 seconds ago Up 5 seconds 443/tcp, 0.0.0.0:8081->80/tcp opencart-docker_apache_1 223f157c1a1d mysql:5.7 "docker-entrypoint.s…" 7 seconds ago Up 6 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp opencart-docker_mysql_1 afc0224d32ab opencart-docker_php-fpm "docker-php-entrypoi…" 7 seconds ago Up 6 seconds 9000/tcp opencart-docker_php-fpm_1

matt-t-d commented 4 years ago

Looks like it is running correctly. Did you set the mysql hostname?

On a brand new installation set it here: configuration-step-to-install-opencart

On an existing installation change the value set in the config.php and admin/config.php files from define('DB_HOSTNAME', 'localhost'); to define('DB_HOSTNAME', 'mysql');