Home > Backend Development > PHP Tutorial > thinkphp require prompts that the upper-level directory does not have permissions. How to configure apache?

thinkphp require prompts that the upper-level directory does not have permissions. How to configure apache?

WBOY
Release: 2016-07-06 13:53:44
Original
1623 people have browsed it

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

<code><VirtualHost *:88>
DocumentRoot /www/web/website/public_html
ServerName new.website.com
ServerAlias new.website.com
ErrorDocument 400 /errpage/400.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
ErrorDocument 503 /errpage/503.html
php_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>
</code>
Copy after login
Copy after login

May I ask the master how to solve the problem? Baidu can’t find it

Reply content:

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

<code><VirtualHost *:88>
DocumentRoot /www/web/website/public_html
ServerName new.website.com
ServerAlias new.website.com
ErrorDocument 400 /errpage/400.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
ErrorDocument 503 /errpage/503.html
php_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>
</code>
Copy after login
Copy after login

May I ask the master how to solve the problem? Baidu can’t find it

require /website/Obviously something is wrong. The error message means that this directory does not exist at all. You need to use a relative path or /www/web/website here. You see, your apache configuration is written with DocumentRoot /www/web/website/public_html.
If you definitely want to use an absolute path, it is best to execute echo __DIR__ first to see what the full path is.

Related labels:
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