Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issues] $_SERVER['DOCUMENT_ROOT'] & No such file or directory #230

Open
TinTikls opened this issue Jan 10, 2023 · 0 comments
Open

[Issues] $_SERVER['DOCUMENT_ROOT'] & No such file or directory #230

TinTikls opened this issue Jan 10, 2023 · 0 comments
Assignees

Comments

@TinTikls
Copy link

which Branch / PHP Version are you using ?
php8.2.1

Expected behavior

Hi. I'm new to docker, I've used openserver before, so I ran into this idiotic problem, but I couldn't solve it.
I use $_SERVER['DOCUMENT_ROOT'] to connect my files, but since apache document root is in a different default folder, it can't find the files I need because they are not there, respectively.

I changed APACHE_DOCUMENT_ROOT: ${APACHE_DOCUMENT_ROOT-/var/www/html} to the path of my project, and also did this in the .env file, but after that I get a 403 error.

The apache log is.
[Tue Jan 10 23:12:03.613929 2023] [authz_core:error] [pid 18] [client 172.18.0.1:60276] AH01630: client denied by server configuration: /var/projects, referer: http://localhost/

In ./config/vhost/default.conf I have set
<Directory ${APACHE_DOCUMENT_ROOT}
require all granted

I also tried
AllowOverride all
Allow from all

I also set it recursively to 777 for all the folders beginning with www

This has no effect and I get an error.

The only possible solution to this problem and running the project locally is to specify full paths to files on the system, then it finds them. But this way I will break my application in web.

Is there any other solution to my idiotic problem?

  • Ubuntu
  • Docker version 20.10.22, build 3a2c30b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants