PHP prompts that there is no permission for the upper-level directory of require, so how to configure apache?

黄舟
Release: 2023-03-11 11:50:01
Original
2104 people have browsed it

The website uses the thinkphp5 framework, and the server is built with wdcp
Then upload the public files to the /website/public_html directory
Other inaccessible framework files are placed in /website/ directory
But when php require some classes in the /website/ directory, it will prompt Failed opening required
It is estimated that the setting of wdcp causes no permissions
Attached to wdcp Apache settings

<VirtualHost *:88>
DocumentRoot /www/web/website/public_html
ServerName new.website.comServerAlias new.website.
comErrorDocument 400 /errpage/400.htmlErrorDocument 403 /errpage/403.htmlErrorDocument 404 /errpage/404.htmlErrorDocument 503 /errpage/503.htmlphp_admin_value open_basedir /www/web/website:/tmp
<IfModule mod_deflate.c>
    DeflateCompressionLevel 7
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
    AddOutputFilter DEFLATE css js html htm gif jpg png bmp php
</IfModule>
</VirtualHost>
<Directory /www/web/website>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
Copy after login

Could you please tell me how to solve it? I can’t find it on Baidu.

require /website/ is obviously wrong. Error message also means that this directory does not exist at all. , use relative path or /www/web/website here. You see, your apache configuration has DocumentRoot /www/web/website/public_html written.
If you must use an absolute path, it is best to execute echo DIR first to see what the full path is.

The above is the detailed content of PHP prompts that there is no permission for the upper-level directory of require, so how to configure apache?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!