search

Home  >  Q&A  >  body text

php - Nginx setting open_basedir cross-site restriction problem

I made the following configuration in nginx based on the Nginx configuration code provided online:

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

But I found that it can be set up on Amazon EC2, but not on Tencent Cloud. The Amazon EC2 Lnmp environment uses the https://lnmp.org/ one-click environment package, and Tencent Cloud compiles and installs it by itself.

Using phpinfo() to print the open_basedir displayed on Amazon EC are all valuable, but the ones configured on Tencent Cloud are all no value

But it can be configured in php.ini. I really can’t figure it out. I changed it to restart and it also restarted.

Is it a problem with the Nginx version? Amazon's Nginx version is 1.10, and Tencent Cloud's Nginx version is 1.12.

習慣沉默習慣沉默2869 days ago770

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-16 12:05:05

    nginx:

    set php open_basedir

    fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; (The following directories can be set by yourself, such as open_basedir=/home/wwww/:/tmp/, etc.)

    php:
    Restricted directory: open_basedir =/var/www/sina/:/var/www/wangyi/:/var/www/logs/session/. If it is apache, you can use php_admin_value open_basedir to limit

    These are the standard, correct settings. If the relevant VPS cloud is not working, it should be because of the server, it is restricted or something happened.

    reply
    0
  • Cancelreply