Page MenuHomePhabricator

"unable to find composer.json in var/www/html" error on Windows after "docker-compose exec mediawiki composer update"
Closed, ResolvedPublic


I tried to setup media wiki docker on my local machine so i installed docker toolbox and follow this instruction

but when i execute the command docker-compose exec mediawiki composer update

a error comes that says unable to find composer.json in var/www/html

i tried to change environment variable COMPOSER_CONVERT_WINDOWS_PATHS = 1 But still same error

please some one help me to fix this

operating system : windows 7
docker toolbox version: 19.03.01

Event Timeline

Gaura87 updated the task description. (Show Details)
Gaura87 edited subscribers, added: zeljkofilipin; removed: Aklapper.
Aklapper renamed this task from Trying to setup media wiki docker on my local machine to "unable to find composer.json in var/www/html" error on Windows after "docker-compose exec mediawiki composer update".Mar 27 2020, 9:05 AM
Aklapper added a project: Documentation.
Aklapper updated the task description. (Show Details)

Thanks for filing this task @Gaura87. As I mentioned on IRC I'm pretty sure this is a problem with not sharing the directory with the VM that Docker Toolbox uses. See this post for example.

We should update the documentation to clarify that we recommend Docker for Mac and Docker for Windows for those OS'es, as well as a section about how to get this working properly with Docker Toolbox and Windows 7.

@kostajh I tried to change the shared folder , but still it doesn't work

@Gaura87 can you please provide screenshots of what you changed with the shared folder of the VM?

Thanks. In IRC yesterday you were using a folder called “core”, did you rename it to “mediawiki”?

Did you restart the VM and/or your computer?

Yes @kostajh i rename that folder to mediawiki and yes i restart vm after changing shared folder

@kostajh @zeljkofilipin I am still stuck on this, please suggested me what should i do!

@Gaura87 it's difficult because I don't have a Windows 7 setup. Searching online for "docker toolbox windows 7 mount volume" yields a lot of forum and blog posts about it. As a next step, I would read through those articles and forum posts and experiment with different ideas to get this working.

Reading the Docker Toolbox docs, maybe you should try cloning MediaWiki core into a subdirectory of C:\Users and trying the installation in that directory.

@kostajh Actually there are two versions of docker one is docker desktop amd one is docker toolbox, docker desktop requires a hyper -v component in Windows which is only available in Windows 10 pro edition so if you had any other versions than pro than you can install docker toolbox and try to troubleshoot this thing.
And i also want to ask that Is composer is pre included in docker-compose?

Gaura87 triaged this task as Medium priority.Mar 27 2020, 6:02 PM
Gaura87 added a subscriber: Jpita.
Aklapper raised the priority of this task from Medium to Needs Triage.Mar 28 2020, 12:12 PM

Resetting task priority.

hello !! Did you find any solution?

@Gaura87: It is weekend. People have real lifes. Please be way more patient and do not ping people after 22 hours. Thanks.

I am sorry @Aklapper , I just want to do some micro tasks from and forget it is a weekend ....
Sorry again !!

@Gaura87 I'm sorry, I don't have a windows machine and I don't have much experience with Docker on Windows.

@Gaura87 as an alternative to Docker, you could try running Selenium tests targeting MediaWiki in MediaWiki-Vagrant. Follow this page and let me know if you have any problems (in a separate task).

You will probably have to shut down Docker before you start using MediaWiki-Vagrant.

Instead of installing MediaiWiki-Vargant , I installed Ubuntu Bionic on my machine and successfully installed MediaWiki-Docker .
But when I access localhost:8080 ,It says cant connect to database , Is that Okay?

hello !! @kostajh @zeljkofilipin Did you find any solution?

Hi, because you have a Windows 7 setup, you are probably in the best place to try to figure out the solution to it. If you figure it out, please do submit a patch to with your notes or comment here. Thanks!

But when I access localhost:8080 ,It says cant connect to database , Is that Okay?

@Gaura87 it sounds like you might have missed this setup section for Linux:

Ok, i will. Check my local variable, but i want to say that documentation in this link for setup media wiki docker is not detailed nethier for Windows nor for lunix

I Tried to set variables but still it was showing MW_DOCKER_UID is not set.
Terminal output is attached below.

@Gaura87 that's because you are executing docker-compose with sudo. Compare the output of sudo id -u and id -u to see the difference. Please have a look at for how to run Docker without using sudo.

Thanks @kostajh , I make a group docker and run docker-compose without sudo and also give permision to docker in files - docker-compose.yml,docker-compose.override.yml and LocalSettings.php but still faceng same error of cant acess the database

Thanks @kostajh for your help ,i solved this problem,actually the database foder SQLite in Cache folder is owned by root and docker group does not had permision to acess it I change the Permission to docker Group by sudo chown -R $USER Thanks for the help :)