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.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!