Mubin Mubin - 1 month ago 14
PHP Question

Homestead no input file specified for custom PHP project

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

Answer

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.