几个问题laravel和aws的坑

1.AWS安装nginx软件一直失败,没有任何提示
经过九牛二虎之力,发现磁盘空间蔓了,悲剧!!!

添加磁盘方法
首先备份快照,然后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

我发现这个和虚拟机的配置文件有关系,如下两个,一个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;
}

有知道原因的可以留言!

添加一个,这样做之后,服务器不稳定,已经关闭了服务器安全策略而且删除了.user_info.ini文件,但是,偶发还是会出现服务器找不到,input file not found类似的问题,最后,解决方法是,删除fastcgi.conf中的param ADMIN的那个就可以了。记得重启nginx

你可能感兴趣的:(几个问题laravel和aws的坑)