PHP & MySQL: Novice to Ninja 6th edition - where to place index.html file on windows in Chapter 1, p12

I’m stuck on the most basic step! I’m working in Windows 10, and have installed Git, VirtualBox, and Vagrant. I’ve successfully run the git clone command on p10, and was able to run vagrant up & the vm is up and running without errors. The part I’m stumped on is p12, which is where I should be creating the index.html file. Does this need to be done in the vm itself, or can it be done on my local windows pc (in file explorer)? If it needs to be done in the vm, how can I use a text editor (other than a command line one), such as notepad++, atom, etc. in order to create the index.html file and save it within the vm?

Create the file in your preferred text editor.
According to page 12, it should be saved in the “Public” folder within the “Project” folder.
It does not matter how or where you write the file, so long as it is saved in the right location.

Yes, but can you give me more instructions on specifically how? The Public folder seems to only exist within the vm, correct? So, how would I open my text editor, Notepadd++ for example, on my pc, and what path would I point to in order to reference that location in the vm? Or, is there another way?

I’m sorry, but I need a little more guidance in precisely how to do this. I appreciate any help!

I don’t use the same VM set up myself, so forgive my ignorance. But I would think that the folders and files will exist somewhere in the file system of your physical disk drive in the PC.

Looking at page 10 of the book, the instructions for installing the VM, it looks like you choose where to store the webside at this point in the instalation:-

We’ll be using a pre-built virtual machine (or “box”) called Homestead Improved.
This contains PHP, MySQL and NGINX already configured for development
purposes. To download it, from your terminal prompt firstly navigate into the
directory you wish to store your website’s files in,
and then run these commands:…

^My bold.

Thanks again for trying to help! I was finally able to sort this out. The equivalent of the Project\public folder created in the vm winds up being stored in the local system here (in win 10 at least):
C:\Users\yourusername\my_project\Project\public
Any files that get placed here will also be accessible via the vm! This was what they didn’t specify in the book & what was stumping me. I was looking into how to share a folder in a vm with the host, but it looks like that is not needed.

2 Likes

Glad to hear you solved the problem and thanks for explaining how you did it in case others come across a similar issue.

1 Like

As SamA74 pointed out, wherever you run the vagrant up command from is where it looks for you files. The location can be anywhere on your PC.

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