LNMP安装laravel遇到500的坑
环境:centos 7,Lnmp 军哥,php7
坑1:composer遇到 has been disabled for security reasons。。。
修改php.ini,去掉proc_open,proc_get_status,symlink, 这几个函数的disable.
坑2:Warning: Accessing packagist.yunsom.cn over http which is an insecure protocol.
是因为composer的数据源需要https访问,而.cn库无法访问,切换composer的数据源即可。好像连续4次失败,composer也会自动切换。
坑3:nginx的环境下,打开laravel显示500错误。
不用按照网上的方法去改fastcgi_param 。
直接在public下建立.user.ini 内容是:open_basedir=/项目路径/:/tmp/:/proc/ 注意不要包含public,是public的上级目录。
最后贴一下nginx laravel的配置——适合军哥lnmp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
server { listen 80; #listen [::]:80; server_name doc.koodeng.com ; index index.html index.htm index.php default.html default.htm default.php; root /项目路径/public; #error_page 404 /404.html; # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php.conf; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log /日志路径.log; } |
噢!评论已关闭。