Open_basedir restriction in effect, solve the problem of PHP introduction file permissions Lnmp

Source: Internet
Author: User

1. Configure the virtual domain name

server    {        listen 80;        #listen [::]:80 default_server ipv6only=on;        server_name local.siemens.com;        index index.html index.htm index.php;        root  /home/wwwroot/default/siemens/new_hotel/Public;        #error_page   404   /404.html;        include enable-php-pathinfo.conf;        location /nginx_status        {            stub_status on;            access_log   off;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$        {            expires      30d;        }        location ~ .*\.(js|css)?$        {            expires      12h;        }        location ~ /\.        {            deny all;        }        access_log  /home/wwwlogs/access.log;    }

2. Then configure the hosts

 vim /etc/hosts

Add to

127.0.0.1       local.siemens.com

Then restart LNMP

sudo lnmp reload 或者restart

The results reported 500 errors and nothing was seen.

3. Turn on display_errors to see why

sudo vim /usr/local/php/etc/php.ini
display_errors = On

Then restart the access again.

Found or error, I began to suspect that the system environment is not a problem.

4. It was later discovered that configuring directory permissions was possible.

sudo vim /usr/local/nginx/conf/fastcgi.conf

Add the root directory to it.

# PHP only, required if PHP was built with --enable-force-cgi-redirectfastcgi_param  REDIRECT_STATUS    200;fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/";

, restart the LNMP service is OK.

Open_basedir restriction in effect, solve the problem of PHP introduction file permissions Lnmp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.