luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
811 stars 205 forks source link

./vendor/bin/luya import not working 'PDOException' with message 'could not find driver' [docker] #2120

Closed andrewpros closed 2 years ago

andrewpros commented 2 years ago

I had many more issues installing and configuring luya, docs seems outdated, not clear, this is for another time, but i gave up, i need to fix this issue ASAP.

What steps will reproduce the problem?

I just composer create Latest luya-kickstarter-bootstrap4

And then used docker-compose up

After i finally setup everything i just added a new admin module to start the project, added controller, registered in menu...

Now i need the import command, but it doesn't work

I run ./vendor/bin/luya import

What is the expected result?

Well i guess to work, register the new module so i can enable it in admin and start the work on project

What do you get instead? (A Screenshot can help us a lot!)

Exception 'yii\db\Exception' with message 'could not find driver'

in /home/andrew/projects/estate_importer/vendor/yiisoft/yii2/db/Connection.php:647

Caused by: Exception 'PDOException' with message 'could not find driver'

in /home/andrew/projects/estate_importer/vendor/yiisoft/yii2/db/Connection.php:721

https://i.imgur.com/AGetDnq.png

I had a command issue before due to wrong info in the docs, but this seems like there is no PDO driver in the docker php/nginx image??? Im not sure how the import command works.

A need any QUICK FIX, it can be the worse workaround possible i just need it to work!!!

LUYA Check ouput (run this script and post the result: luyacheck.php)

Not working for nginx i guess

Additional infos

No sure the versions, i used the latest luya-kickstarter-bootstrap4 Q A
LUYA Version Latest docker-compose
PHP Version Latest docker-compose
Platform Latest docker-compose
Operating system Windows WSL2/Linux
nadar commented 2 years ago

Hi @andrewpros

if you run the project with docker-compose you need to run the commands inside the docker environment.

docker-compose exec luya_web luya import

Updated:

docker-compose exec luya_php luya import

If https://github.com/luyadev/luya-kickstarter-bootstrap4/blob/master/docker-compose.yml this is what your docker-compose looks like

nadar commented 2 years ago

sorry, just saw its the setup separated into two services (https://github.com/luyadev/luya-docker-php) so you can see the examples there, its:

docker-compose exec luya_php luya import

in your case. You can always ssh into the docker container and run the way you described above.

docs seems outdated, not clear, this is for another time, but i gave up, i need to fix this issue ASAP

Let me know what we can updated, or maybe help, would be awesome.

andrewpros commented 2 years ago

Yes, thx for the quick answer, this works.

As for other issues, this command is one example of them

The docs state docker-compose exec luya_web luya import, but it MUST be luya_php or it wont work, i knew this already. But it doesn't mention the luya import must also be run that way when registering modules.

I will later make more "docs and setup issues" oriented entry, no time now.

nadar commented 2 years ago

The docs state docker-compose exec luya_web luya import, but it MUST be luya_php or it wont work

Can you show me the location of that? thanks