英文:
How to change ddev php container docroot path from /var/www/html
问题
我需要更改ddev在php容器中设置的文档根路径,因为我的代码源中已经有一个html文件夹,并且自定义的包含路径确定不起作用。
代码会查找html的第一个出现位置以设置包含文件的路径到另一个位置。但是因为代码和ddev php容器都有html,路径中现在有两个html的出现,所以代码现在形成了不正确的路径。这是旧代码,这个例程在代码中多次执行,所以我宁愿不更改每个文件以避免更大的拉取请求差异。
我想将它从/var/www/html/更改为/var/www/
请您给予建议。
英文:
I need to change the docroot path that ddev sets up in the php container because I have some code that has already had an html folder in its source and bespoke include path determination is not working.
The code looks for the first occurrence of html to set a path to include files at another location. But because both the code and ddev php container have html, there are 2 occurrences of html in the path and the code now forms the path incorrectly. It's legacy code and the routine is done many times in the code so I'd rather not change each file to avoid larger pull request diffs.
I would like to change it from /var/www/html/ to /var/www/
Please can you advise.
答案1
得分: 1
我不建议这样做,但你可能只需在 docker-compose.mounts.yaml
中添加另一个挂载点:
services:
web:
volumes:
- ../:/var/something
使用 /var/www
会导致很多问题,因为它会引起重叠。
更多细节请查看 https://ddev.readthedocs.io/en/latest/users/extend/custom-compose-files/
英文:
I don't recommend this, but you can probably just add another mount in a docker-compose.mounts.yaml
services:
web:
volumes:
- ../:/var/something
Using /var/www will cause much pain because it will cause an overlap.
More detail in https://ddev.readthedocs.io/en/latest/users/extend/custom-compose-files/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论