Homestead 安装完成后访问项目 No input file specified.

homestead 安装完成后访问项目 No input file specified.

hosts文件已经配置

homestead 安装完成后访问项目 No input file specified.
homestead.yaml里面配置的大小写也检测过了,没错

homestead 安装完成后访问项目 No input file specified.

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/Code

sites:
    - map: homestead.test
      to: /home/vagrant/Code/public

databases:
    - homestead

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 8

file
vagrant up 的时候有共享文件夹吗?

4年前 评论

@轻描淡写 有映射成功,

file
我之前访问还出现了laravel的500错误页面,后面因为想要查询错误原因重启vagrant虚拟机后不能访问了

4年前 评论

@Thresh-stone 到这个文件夹下面看一下有没有配置文件 /etc/nginx/sites-available

4年前 评论

@轻描淡写

file

server {
    listen 80;
    listen 443 ssl http2;
    server_name .homestead.test;
    root "/home/vagrant/Code/public";

    index index.html index.htm index.php;

    charset utf-8;

    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; }

    access_log off;
    error_log  /var/log/nginx/homestead.test-error.log error;

    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }

    location ~ /\.ht {
        deny all;
    }

    ssl_certificate     /etc/nginx/ssl/homestead.test.crt;
    ssl_certificate_key /etc/nginx/ssl/homestead.test.key;
}

看这个配置文件好像也没什么问题

4年前 评论

@轻描淡写
查看了一下nginx错误日志

2019/11/27 09:25:09 [error] 798#798: *14 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(/home/vagrant/Code/public/index.php) is not within the allowed path(s): (/www/wwwroot/laravel/:/tmp/:/proc/) in Unknown on line 0
PHP message: PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Unable to open primary script: /home/vagrant/Code/public/index.php (Operation not permitted)" while reading response header from upstream, client: 192.168.10.1, server: homestead.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "homestead.test"

这个是没有权限导致的吗?,但是我有给整个目录权限,还是说是PHP配置有问题?

file

4年前 评论

你别把项目直接放在code文件夹看看

4年前 评论

@轻描淡写
感谢,确实是.user.ini的里面有一个

open_basedir=/www/wwwroot/***

导致的
删掉就正常了

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!