欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決tp5在nginx下修改配置訪問的問題

 更新時(shí)間:2019年10月16日 10:55:46   作者:Mr_Yanghao  
今天小編就為大家分享一篇解決tp5在nginx下修改配置訪問的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧

第一:修改nginx配置

注意:所有配置都是基于lnmp1.4的一鍵安裝環(huán)境的

根據(jù)自己的nginx配置,找到正確的fastcgi.conf,修改fastcgi_param參數(shù)

將默認(rèn)的路徑修改至自己的項(xiàng)目根目錄的上一級,注意是上級?。?!

3、lnmp nginx reload

lnmp nginx restart

第二:執(zhí)行service nginx restart命令重啟nginx,發(fā)現(xiàn)網(wǎng)頁報(bào)404錯(cuò)誤,需要配置一下偽靜態(tài)可以在/usr/local/nginx/conf/www.tp5.com.conf(根據(jù)實(shí)際情況而定)添加:

location ~ .*\.(php|php5)?$
  {
    #fastcgi_pass unix:/tmp/php-cgi.sock;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi.conf;
  }
  location / {
    if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php?s=/$1 last;
    break;
    }
  }

代碼放在server{} 內(nèi)

第三:

php錯(cuò)誤scandir() has been disabled for security reasons

原因:

php.ini里禁用了scandir()方法

解決:

編輯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

最后執(zhí)行/etc/init.d/php-fpm restart重啟下

以上這篇解決tp5在nginx下修改配置訪問的問題就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論