1、刪除隱藏文件 .user.iniphp
一、查看ls -a css
二、lsattr .user.ini html
三、chattr -i .user.inipython
四、rm -f .user.ininginx
2、配置nginx www.site.com.confthinkphp
server
{
listen 80;
#listen [::]:80;
server_name www.site.com site.com;
index index.html index.htm index.php default.html default.htm default.php;
root /data/www/www.site.com/public;python2.7
include thinkphp.conf;
#error_page 404 /404.html;url
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }unix
#include enable-php.conf;
location ~ [^/]\.php(/|$)
{
#try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
}code
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/www.site.com.log;
}
3、修改php.ini
一、cgi.fix_pathinfo=1
二、刪除disable_functions 裏的 scandir
4、錯誤
一、OSError: Command /root/.local/share/letsencrypt/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2
解決辦法:
卸載virtualenv
pip uninstall virtualenv
安裝virtualenv
pip install virtualenv
二、 cat ~/.pip/pip.conf
[global] index-url = https://pypi.doubanio.com/simple/ [install] trusted-host=pypi.doubanio.com