1.AWS安裝nginx軟件一直失敗,沒有任何提示
經(jīng)過九牛二虎之力眶掌,發(fā)現(xiàn)磁盤空間蔓了巴碗,悲劇O鹣!具滴!
添加磁盤方法
首先備份快照师倔,然后deattach卷,修改卷趋艘,直接修改attach卷
2.redhat部署laravel,一直報錯500
排查這個問題显拳,需要開啟:
ini_set("display_errors", "On"); error_reporting(E_ALL | E_STRICT);
這樣就看見日志如下
這次不是500 了
Warning: require(): open_basedir restriction in effect. File(/home/ww utoload.php) is not within the allowed path(s): (/home/w /:/tmp/:/proc/) in /home .php on line 25
我發(fā)現(xiàn)這個和虛擬機的配置文件有關(guān)系抖单,如下兩個遇八,一個ok 一個不ok
ok的
server
{
listen 80;
#listen [::]:80;
server_name i.efc.one ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/w4/public;
# include other.conf;
#error_page 404 /404.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
#include enable-php.conf;
#新增 支持php 的配置
location ~ \.php$ {
#不能有下面這句 try_files ,不然報錯500
# try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#這句注意 后面是.sock 不是127.0.0..1
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
不ok的
server
{
listen 80;
#listen [::]:80;
server_name 5.4.e ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/w/e/public;
include other.conf;
#error_page 404 /404.html
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
有知道原因的可以留言刃永!
添加一個,這樣做之后囚玫,服務(wù)器不穩(wěn)定读规,已經(jīng)關(guān)閉了服務(wù)器安全策略而且刪除了.user_info.ini文件,但是束亏,偶發(fā)還是會出現(xiàn)服務(wù)器找不到,input file not found類似的問題定铜,最后,解決方法是揣炕,刪除fastcgi.conf中的param ADMIN的那個就可以了。記得重啟nginx