Moh*_*mad 5 php nginx laravel hhvm laravel-4
我在ubuntu 12.04 LTS 64 whit HHVM Fastcgi服务中安装LEMP服务器,我通过laravel.phar安装laravel(并通过composer测试)当在brwoser中获取我的网站时不显示任何错误但在Chrome开发人员控制台中获取错误500

我在error.log文件中看不到任何错误(laravel - hhvm,nginx)
存储目录权限是777
我的nginx.conf和vhosts文件有基本配置
当我使用PHP CLI或hhvm命令时,它运行良好
谢谢你的帮助:)
我的位置块
location ~ \.(hh|php)$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
Run Code Online (Sandbox Code Playgroud)
HHVM的问题是它没有显示太多错误,你必须继续观察HHVM或Laravel错误日志.
您需要密切关注错误日志.默认情况下,HHVM不会向浏览器报告错误.
检查HHVM日志!
$ tail -n 50 -f /var/log/hhvm/error.log
Run Code Online (Sandbox Code Playgroud)
检查您的Laravel日志!
$ tail -n 50 -f /path/to/laravel/app/storage/logs/laravel.log
Run Code Online (Sandbox Code Playgroud)
配置参考
/etc/nginx/hhvm.conf如果文件尚不存在,请创建一个文件.插入ff:
location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Run Code Online (Sandbox Code Playgroud)
然后将其包含在您的nginx虚拟主机配置中.
例如./etc/nginx/sites-available/laravel
现在为Laravel添加它,根据需要进行编辑:
server {
listen 80 default_server;
root /vagrant/laravel/public;
index index.html index.htm index.php;
server_name localhost;
access_log /var/log/nginx/localhost.laravel-access.log;
error_log /var/log/nginx/locahost.laravel-error.log error;
charset utf-8;
location / {
try_files \$uri \$uri/ /index.php?\$query_string;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
error_page 404 /index.php;
include hhvm.conf; # INCLUDE HHVM HERE
# Deny .htaccess file access
location ~ /\.ht {
deny all;
}
}
Run Code Online (Sandbox Code Playgroud)
然后重新加载Nginx:
$ sudo service nginx reload
Run Code Online (Sandbox Code Playgroud)
由于X-Powered-By标头是由 HHVM 设置的,我假设您的 NGINX 配置正确。500 错误主要来自语法错误或应用程序中引发的异常。也许你在 NGINX 中的 fastcgi 设置仍然是错误的。块里面有什么location *\.php?
尝试采用不易出错的设置并运行php artisan serve以在本地托管您的项目。
| 归档时间: |
|
| 查看次数: |
5904 次 |
| 最近记录: |