duanqu9292 2016-10-29 17:51
浏览 83
已采纳

Homestead没有为自定义PHP项目指定的输入文件

I'm working with Homestead. Laravel apps are just serving fine, but when I try to setup some custom script, it shows me that No input file specified.

Here is my yaml file.

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /Users/Mubin/Sites
      to: /home/vagrant/Code

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

    - map: dev.app
      to: /home/vagrant/Code/dev/index.php
databases:
    - homestead

I just want to put all my code under dev folder and want to access it from vagrant homestead box

Guide where am I doing wrong?

PS.

I tried to remove index.php from the end, and then nginx throws 403 Forbidden

  • 写回答

1条回答 默认 最新

  • douhao7677 2016-11-04 21:43
    关注

    anyone having the same issue, I found a solution, mocked one may be; but it did work for me.

    I added new public folder in my dev folder and place all my other custom PHP scripts put in that.

    Directory structure was something like this for me

    dev
        public
            folder1
                index.php
            folder2
                index.php
            folder3
                index.php
            ...
    

    and I was able to access it like this

    dev.local/folder1/index.php
    dev.local/folder2/index.php
    dev.local/folder3/index.php
    

    and here is my Homestead.yaml file

    ---
    ip: "192.168.30.30"
    memory: 2048
    cpus: 1
    provider: virtualbox
    
    authorize: ~/.ssh/id_rsa.pub
    
    keys:
        - ~/.ssh/id_rsa
    
    folders:
        - map: /Users/Mubin/Sites
          to: /home/vagrant/Code
    
    sites:
        - map: test.app
          to: /home/vagrant/Code/test/public
    
        - map: dev.local
          to: /home/vagrant/Code/dev/public
    databases:
        - homestead
    

    and in my /etc/hosts file

    127.0.0.1    dev.local test.app
    

    Hope this will help someone, someday. :)

    I'd set up vagrant for laravel and custom PHP projects. Also, integrated with PHP Storm to work with x-debug. Leave a message if you've any issue.

    Happy coding, x-debugging.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧