Jump Start PHP Environment - VM fail, can't load homestead page

Hi, I’ve tried to run the steps in the Jump Start PHP Environment book (ch 4), but when I connect with the browser, the site can’t be reached ERR_CONNECTION_TIMED_OUT. I’m not sure if I did it correctly as I’m on Windows 10 and am new to command lines. I used GIT Bash and finally navigated to the right place…it downloaded as expected, but there was an error. I have no idea what it means.

I have set up the host file following the steps, so what to try next?

I’ve never tried this, but that last line shows what seems to be a typo, it’s complaining about a missing folder “h:/mestead…” where the rest seems to talk about “homestead…” - could that be a problem?

Yeah, that’s what I thought, but I haven’t made any changes to the files - just followed the link, downloaded, unzipped and initialized as instructed… Anybody know what the host path is? I’m using Windows and as I suck at command prompts I shoved the unzipped homestead files in the Git Bash program folder (I was having trouble traversing using prompts). I thought it would fail to download any of the files if there was a problem? :confused:

I’m at the point of giving up here…I just don’t have the knowledge of git and VMs etc to troubleshoot this. I followed the instructions in the book, but get the same issue. I have:

  1. navigated to the correct directory using git bash.
  2. run the folderfix.sh (I assume there’s no special command, just folderfix.sh and enter?)
  3. run vagrant up (“vagrant up” + enter).

I keep getting the same error(in the image). I also tried this command: “bash folderfix.sh” and it said can’t read Homestead.yaml: no such file or directory. So I expect that was not a valid command to run it…

I don’t really want to go back to amp stacks, but I see little other option, as I can’t get these instructions to work for me. What a bummer.

@swader - if you’re around, can you help here?

That’s interesting - looks like the folderfix script didn’t execute properly, which is odd since it’s been working fine so far. Could you paste the contents of your Homestead.yaml file here?

1 Like

Thanks for the replies! :sweat_smile:

Just to clarify, I’m on a Windows 10 machine with the software specified in the book installed. As mentioned above, I’m new to Linux-style command lines, so am hoping that’s not the problem. It did seem to download the box though (on vagrant up), but then it got the error…

Here’s the Homestead.yaml file I’ve got:

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

    - map: h:/mestead_improved-master/homestead_improved-master
      to: /home/vagrant/Code

    - map: homestead.app
      to: /home/vagrant/Code/Project/public

    - homestead

    - key: APP_ENV
      value: local

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

**# ports:**
**#     - send: 93000**
**#       to: 9300**
**#     - send: 7777**
**#       to: 777**
**#       protocol: udp**

Yeah, under folders, where you see the h:/mestead… that line needs to be changed to the full path where you put your homestead_improved-master folder. So if it’s on C:, then it’ll be C:/homestead_improved-master, or if it’s in C:/my_virtual_machines/homestead_improved-master then it’ll be that, etc.

If you’re not sure where that location is (i.e. you’re inside homestead_improved-master but you have no idea where exactly it is) just type pwd, or cd or %cd%, I forget which one works best on Windows - to find the full path to the current working directory. That’s what you paste into the “map” part then, after the colon.

In any case, that’s your problem - the map value of the folders section is wrong, there’s nothing on your h: drive, if it even exists. Now I gotta find out why it even ended up using h:/, that definitely shouldn’t happen. Thanks for the heads up, I’m sure this will affect some others now too. Might be something with the most recent Windows update that broke it.

1 Like

Thanks swader! It’s all up and running ie. ‘no input file specified.’. I didn’t have an h: drive, so yes, strange error. Upon vagrant up, I did get an error with default: createdb (database “homestead” already exists), but I’ll assume that it was created in a former attempt…

The defining new sites step isn’t working for me… I have:

  1. edited the hosts file to test.app
  2. edited the Homestead.yaml file to map to the test folder
  3. created the test folder and inserted the new index.php file
  4. reloaded the VM configuration. ( used git bash to “vagrant provisiton” from the homestead_improved-master location.

I get this in bash:

When I load test.app in the browser it shows the old index php file “Hello Virtual Machine!”. The index files are in their correct locations, and I’ve changed the mapping in the yaml file. The only thing I can think of is that the VM didn’t reload properly? If I remove the Hello Virtual Machine index.php from the public folder, the browser shows an error, so it’s still pointing to the old location.

Although the error message looks like there is a problem with the psych.rb file, I suspect you edited the yaml file incorrectly. (tab instead of space, extra space?) Try testing it for validity with the linter.

It’s really not much code to edit…as far as I can tell it’s exactly the same formatting as the one that worked…

LOL Does this mean I can’t judge by eye what is in my code editor? Am I supposed to use a YAML Lint in Brackets to prevent this? I’ll have to read the YAML rule book! I must have had a tab in there… Thanks!

Yeah, tabs don’t play well with YAML :slight_smile: I’ll make a command-line script for adding sites so you can dynamically define them. It’ll be in the book’s next version.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.