配置环境,运行 Laravel
打赏作者

0x8c

code laravel new laravel-ubuntu 命令安装larvael 是怎么实现的?

z531020509

为什么一步步下来的,但是在进行sudo service nignx reload的时候一直是fail

JellyBool 回复 z531020509

配置没对吧,nginx 配置文件的格式没对,仔细看看

z531020509 回复 JellyBool

嗯,检查了下出现nginx: [emerg] unknown directive “try_file” in /etc/nginx/sites-enabled/default:34
nginx: configuration file /etc/nginx/nginx.conf test failed,但是第一次用不知道怎么去修改,网上说的也是模模糊糊的…

z531020509 回复 JellyBool

嗯,修改好之后可以跑了

JellyBool 回复 z531020509

try_files 吧。。。

z531020509 回复 JellyBool

嗯嗯,谢谢老师

JellyBool 回复 z531020509

嗯哼,问题解决了就好

tubaget

我直接从网上git clone的官方的laravel,composer install没有成功,最后页面显示http error 500,什么问题啊

JellyBool 回复 tubaget

基本上是被墙了,你找个好的梯子就行

tubaget 回复 JellyBool

我是搭建在我的虚拟机上的~~

making 回复 tubaget

哥们,我也遇到一样的问题,请问怎么解决的呢。。求教~~

makehappier 回复 making

修改镜像命令composer config -g repo.packagist composer https://packagist.phpcomposer.com

liudong0763

老师,我阿里云的centos7的服务器的装了 nginx,但是好像没有 www-data 用户组,我改变文件的用户组为 php-fpm 网站就可以访问了,是不是 php-fpm 和 www-data 是一样的?

JellyBool 回复 liudong0763

这个我不太清楚了,你搜一下 centos 的 nginx 用户和用户组

huangdi

我这边一直报502 呢

JellyBool 回复 huangdi

基本上就是 nginx 没配置对吧,你看看 nginx 的 errors.log 就可以知道了

canihelpyou

在centos7.2上yum安装了php7.1后,配置/etc/php-fpm.d/www.conf文件时,有个listen选项:

listen = 127.0.0.1:9000  //默认是这样的。

视频中说要改成这样:

listen = /var/run/php-fpm.sock

可是系统中没有php-fpm.sock这个文件,用find搜索全部地方,都没有找到。

JellyBool 回复 canihelpyou

我对 centos 并不熟悉,你可以使用默认的:

listen = 127.0.0.1:9000 
yaoye6262

按照这个视频 在阿里云服务器安装 好像nginx装不了!

求辅助举报

老师好我按照视频里面进行到sudo vim /etc/php/7.1/fpm/pool.d/www.conf之后出现的是```
; Start a new pool named ‘www’.
; the variable $pool can we used in any directive and will be replaced by the
; pool name (‘www’ here)
[www]

; Per pool prefix
; It only applies on the following directives:
; - ‘access.log’
; - ‘slowlog’
; - ‘listen’ (unixsocket)
; - ‘chroot’
; - ‘chdir’
; - ‘php_values’
; - ‘php_admin_values’
; When not set, the global prefix (or /usr) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

请问我接下来该怎么操作
JellyBool 回复 求辅助举报

这个是正常的吧

求辅助举报 回复 JellyBool

是的 ,是刚才不小心删除了后面大段代码然后保存推出了 重新安装fpm就好了 很尴尬

zixi

/var/www/laravel-ubuntu# vim .env
这个创建后里面是没有东西吗?(第一次操作这个)

JellyBool 回复 zixi

你跟着视频的操作,执行这个相当于创建了一个新的 .env 文件,再往里面copy线下的 env 文件的内容就是了。

WhiteInk404

composer --no-dev一直安装失败,翻墙、换国内镜像都试过了,还是不行,求指教!

JellyBool 回复 WhiteInk404
composer install --no-dev

这样的么

WhiteInk404 回复 JellyBool

是的,刚刚解决了问题,是因为没有安装zip和unzip,不过为什么在执行composer install的时候提示的是网络超时呢,郁闷,

WhiteInk404

查了一下nginx的error log,出现以下错误:
2017/04/07 13:25:58 [error] 22825#0: *55 FastCGI sent in stderr: "PHP message: PHP Warning: require(/var/www/laravel-ubuntu/bootstrap/…/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/laravel-ubuntu/bootstrap/autoload.php on line 17

玩世顽童

.env的配置怎么生成的?可以直接用UP主的吗

JellyBool 回复 玩世顽童

直接copy .env.example 就好了

玩世顽童 回复 JellyBool

嗯,后来看到了

hekunyu

你好 3:17秒左右说的社区在哪里,需要到哪里找

algeryy

阿里云下面curl localhost已经有了,用IP访问却打不开。防火墙我都禁了 是啥原因,有碰到的么

ab1958

composer install
[RuntimeException]
/var/www/laravel-ubuntu/vendor does not exist and could not be created.
这个是什么错呢。该怎么解决。

jimuXue

composer的安装怎么跳过啦

mhcyong

全部配置好后,IE浏览器可以正常打开页面,Chorme输入地址回车后直接下载了一个文件,是哪里配置有问题吗?

JellyBool 回复 mhcyong

不清楚,这样的描述我也不知道问题在哪

biggerdong

一切都执行完之后,为什么会是403报错呢?public路径、读写权限全开了!

JellyBool 回复 biggerdong

看看 log 呗,基本就知道问题了

biggerdong 回复 JellyBool

nginx_error.log里面啥都没提示就很迷,没有任何的提示

JellyBool 回复 biggerdong

额。。。laravel log 呢? 403 感觉很奇怪啊

biggerdong 回复 JellyBool
Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))

把PHP7默认的报错信息关闭启动了,nginx还是没有报错记录,laravel log几乎都是这样的报错,现在是500了,太难受

JellyBool 回复 biggerdong

这样是直接走到 laravel 里面了,你开一下 debug 看看,排错之后再关 debug

biggerdong 回复 JellyBool

.env里的么?都开了!没有显示什么东西!现在就是,重新在服务器端new了一个新项目,composer install、public路径、storage权限、组权限都开了。

JellyBool 回复 biggerdong

.env里的么?都开了!没有显示什么东西!

额,这么奇怪。。。那我就无能为力了

big tree 回复 biggerdong

403的问题解决了吗?能否告知一下解决方法?

biggerdong 回复 big tree

我忘了,你可以试试oneinstack一键安装包,如果你急着上线网站,没什么问题。

big tree 回复 biggerdong

好的,谢谢!

thirdriver

配置完成后一直502 参考网上教程修改了fastcgi一些参数还是无效

thirdriver

在ssh链接vultr发现延迟特别明显 输入命令基本有2-3秒的延迟

thirdriver

问题解决了 帮助遇到这个问题的其他人 是socket路径不对 正确路径应该是/var/run/php/php-fpm.sock 会少了一个php

big tree

为什么vim编辑器里面光标不能左右移动,删除键也不能用?h、l、删除键都只能下移

JellyBool 回复 big tree

vim 有一些独有的操作模式。左右移动当然不成问题,你按下方向键都是可以的

big tree

Unable to start ‘chown’: There is no application associated with the given file name extension 这个问题怎么解决?

JellyBool 回复 big tree

你具体执行的命令是什么?

big tree 回复 JellyBool

sudo chown -R www-data:www-data /var/www

JellyBool 回复 big tree

这个确定有 /var/www 目录么?不然我感觉也不知有啥问题了

big tree 回复 JellyBool

确定有,不知道为什么,有些命令执行起来很正常,有些命令还会告诉我无法解析主机。

big tree 回复 JellyBool

这个也解决了,/etc/hosts 文件 127.0.0.1 localhost 加上主机名就好了。

big tree

sudo chown -R www-data:www-data /var/www

big tree

git push -u origin master 的时候为什么总让我输入Atlassian账户?这个是必须的流程还是可以避免?可以避免的话又怎样操作?

JellyBool 回复 big tree

使用 ssh key 这种认证方式应该不用了。

big tree 回复 JellyBool

解决了,谢谢!

big tree

nginx.service" and “journalctl -xe” for details. 请问这个是什么原因? nginx -t 显示 nginx: [emerg] directive “location” has no opening “{” in /etc/nginx/sites-enabled/default:63
nginx: configuration file /etc/nginx/nginx.conf test failed

big tree

/etc/nginx/sites-enabled/default文件:
location ~ .php${
try_files uri/index.php=404;fastcgisplitpathinfo(.+\.php)(/.+)uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+);
fastcgi_pass unix:/var/run/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME documentrootdocument_rootfastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

JellyBool 回复 big tree

感觉就是 多了一个 { 或者少了一个括号 {

big tree 回复 JellyBool

检查了2遍,没少

JellyBool 回复 big tree

directive “location” has no opening “{”

我觉得还是这个错误,感觉是少了一个 {

big tree 回复 JellyBool

我看了另一个你的17年6月的视频,解决了。有可能是版本配置不一样的问题

不了了了了了之

如果我有一个subdomain, 除了在openssl处加入以外,nginx这里要怎么配置?如何指定到subdomain的文件?

JellyBool 回复 不了了了了了之

多开一个 nginx 的 server block ,指定你的 server_name 为你的 subdomain 就好

krui

file_put_contents(/vagrant/php/laravel_blog/storage/framework/views/0238e1aca189782c281026a4d1ed59a80e6a88fa.php): failed to open stream: Permission denied.
【0238e1aca189782c281026a4d1ed59a80e6a88fa.php】这个文件根本就不存在。
这个文件给的权限也是最大的-rwxrwxrwx. 1 vagrant vagrant 13379 Nov 27 10:29 Filesystem.php

JellyBool 回复 krui

清除缓存应该差不多了!

zzjdy_0

我安装视频的流程做了一遍,结果访问服务器ip一直是nginx的欢迎界面

sunyl053800

安照此步骤操作,给予目录权限,还是报502 Bad Gateway
nginx/1.10.3 (Ubuntu) 急急急急急急!!!!!!!

frankunderwood

安装视频走,到composer install 的时候killed了,是虚拟机内存不足吗?