Home > Article > Backend Development > PHP prompts that there is no permission for the upper-level directory of require, so how to configure apache?
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>
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!