Nginx + phpはopenを使います

  
                  次の3つの設定方法では、PHPバージョン5.3以上が必要です。方法1)Nginx設定ファイルにfastcgi_param PHP_VALUE" open_basedir = $ document_root:/tmp /:/proc /"を追加する通常nginxサイト設定ファイルはinclude fastcgi.conf;を使用します、このようにして、 fastcgi.confでも大丈夫です。サイトで追加のディレクトリを別に設定する必要がある場合は、上記のコードをinclude fastcgi.confに記述してください(この行はOKです)、fastcgi.confの設定は上書きされます。このメソッドはnginxを再起動した後に有効にする必要があります。方法2)php.iniに追加します。[HOST = www.45it.com] open_basedir = /home /www /www.45it.com:/tmp /:/proc /[パス= /home /www /www.45it] open_basedir = /home /www /www.45it.com:/tmp /:/proc /この設定はphp-fpmの再起動後に有効にする必要があります。方法3)Webサイトのルートディレクトリに.user.iniを作成し、次のように書き込みます。open_basedir = /home /www /www.45it.com:/tmp /:/proc /この方法では、nginxサービスまたはphp-fpmサービスを再起動する必要はありません。セキュリティ上の理由から、.user.iniファイルの書き込み権限は削除する必要があります。 .user.iniファイルの詳細な説明:http://php.net/manual/zh/configuration.file.per-user.php open_basedirを設定することは、次のようにコマンドを実行する機能を無効にするのに最善です。shell_exec( 'ls /etc ')/etcディレクトリのファイルリストを確認してくださいshell_exec(' cat /etc /passwd ')/etc /passwdファイルの内容を表示することができます推奨される機能は次のとおりです。 pcntl_wifexited、pcntl_wifstopped、pcntl_wifsignaled、pcntl_wexitstatus、pcntl_wtermsig、pcntl_wstopsig、pcntl_signal、pcntl_signal_dispatch、pcntl_get_last_error、pcntl_strerror、pcntl_sigprocmask、pcntl_sigwaitinfo、pcntl_sigtimedwait、pcntl_exec、pcntl_getpriority、pcntl_setpriority、evalを、popenの、パススルー、幹部、システム、もしくはshell_exec、は、proc_open、proc_get_status、chroot環境、 chgrp、chown、ini_alter、ini_restore、dl、pfsockopen、openlog、syslog、readlink、symlink、popepassthru、stream_socket_server、fsocket、chdir
Copyright © Windowsの知識 All Rights Reserved