ThinkPHP 5をインストールする.0.12で発生した小さな問題

1441 ワード

1.まずnginxの構成を変更する
server
    {
        listen 80;
        #listen [::]:80;
        server_name www.uukd.net uubd.net;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.uukd.net/public;

        include none.conf;
        #error_page   404   /404.html;
        include enable-php.conf;


if ($http_host !~ "^www.uukd.net$") {
	rewrite  ^(.*)    http://www.uubd.net$1 permanent;
}

 if (!-e $request_filename) {
 rewrite ^/index.php(.*)$ /index.php?s=$1 last;
 rewrite ^(.*)$ /index.php?s=$1 last;
 break;
 }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }

rootの後に追加:/public
2.scandir() has been disabled for security reasons
phpを落とすiniの無効化関数
簡単ですphpを編集します.iniファイル
disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopenはscandirを除去して保存しphp-fpmを再開すればよい.
php.iniの位置:/usr/local/php/etc/php.ini
3.php-fpmの再起動
最後に/etc/initを実行する.d/php-fpm restart再起動下
再起動してからページをリフレッシュすると、以前に報告された警告がなくなったことに気づきます.