I've combed through similar threads, but none are quite the same issue. I've installed Homestead a handful of times now and seem to always have some kind of issue.
So I've created a www folder on my desktop and cloned the laravel/homsetead in there. I "cd" into www/Homestead and run "bash init.sh" but it created the .homestead hidden folder containing Homestead.yaml, after.sh, and aliases file in my Windows "Users" directory. I can copy/past the files into www/Homestead, edit the Homestead.yaml file accordingly, but then I get a slew of errors when I do vagrant up. Any idea why the init shell file points to that directory and how that could be effecting things?
I resolved this by cloning laravel/homestead in my user directory and adding a /Code folder. init.sh ran fine and vagrant up worked without issue.??????
NONO,it doesn't work for me
Related
So , I am working on a small project where I need to create a symlink to store file in the storage directory in laravel. I was previously working on windows where the same code was working fine but as I configured Laravel Sail and set it up in my WSL-2 environment, I performed my ritualistic tasks of setting up the config, creating symbolic link, I am noticing a weird behavior of running the php artisan storage:link command where it creates a file instead of a folder in my app/public folder.
It should be a clickable folder or if not clickable, atleast my IDE should show it as a directory like that of others, i.e. like public, bootstrap, database folders. Is that a problem with my WSL or some internal configuration of Laravel. On double clicking this link it shows:
Any assistance will be greatly appreciated.
If you created it in wsl2, windows won't regonize it as a symlink, it's a unix symlink and not a windows "symlink" that's all.
In WSL you're working inside a unix based filesystem and sharing your filesystem with windows.
Its because your file its just accessible in the docker container created by sail. You cant access to it like this.
note: this is not an error or missing. it is just a behavior
In my case the happened in Ubuntu since I had to connect my storage/app/public folder to public/storage. at first glance, I was confused, and seemed to be an error but with some more try and fail it was correct as it is. the problem was, in Windows all our files existed in a symlink to the public/storage folder and from there we could delete and manipulate the file but after creating the file symlink all files are only visible in storage/app/public directory but can access from public/storage folder from the web easily.
As a work around, created folder manually and run the command.
sail php artisan storage:link.
It will link
I have working SS v3.4 project locally. Now I want to deploy it. I've copied files to the server, run composer install to install vendor libraries. When I run install.php all requirements are fine except for missing mysite folder errors. That's intended because I renamed my project folder to let's say mydomain and it works fine on localhost. AFAIK SS should pick up the custom folder and recognise it as THE page folder. Somehow it doesn't happen. Any ideas why?
This is expected, since the installer specifically looks for "mysite".
You probably have two options:
Rename app to mysite on the serve, re-run the installer then rename the folder back to app
Don't run the installer at all - if you configure your own _ss_environment.php file and ensure assets folder is writeable you shouldn't need it
I've got a school project and I pushed this to my bitbucket account.
A friend of me needs to pull this project to do some changes and other stuff.
The problem is, whenever he pulls the project and tries to open vagrant, there are no files in his "vagrant ssh".
We tried the 'composer install' for the vendor files.
We got another homestead.yaml file for launching vagrant but it still doesn't seem to fix our problem.
For my part everything works fine, but when my friend pulls the project localy he just can't seem to find any files in his 'vagrant ssh environment'
Homestead.yaml is there for binding the local storage to the virtual environment. Why doesnt he try to do the vagrant ssh first, and then do the pull request inside the shell?
EDIT:
Just try to do things in order. If he followed the instructions for the Laravel installation, his project folder should be something like C:/Project/PHP/Project_name and that route should be specified inside the homestead.yaml file like so:
folders:
- map: C:\Project\PHP
to: /home/vagrant/Code
So it says to bind PHP folder on local disk to virtual folder /code in vagrant.
After that create the project folder inside PHP folder, and pull the files inside, and modify the homestead.yaml once again to bind the project to browser like so:
sites:
- map: project_name.dev
to: /home/vagrant/Code/Project_name/public
And what is left is to modify hosts file to bind that name to the IP address:
192.168.10.10 project_name.dev
He should open the Homestead.yaml and check if the "folders" config reflects the mapping of the project on his machine.
I have tried running the following code, and even though it runs and sets the nginx blocks ok, its not linking to the folder in question with in the host machine.
serve projects.dev /home/vagrant/Code/projects.dev
When i then list the folders within the Code folder on the guest machine, i only get the folders that were created via the automated Yaml config file on init set up.
It seems not be creating the folder and/or linking to it at all with between the guest and host machines
Running it on a iMac OS Mavericks.
Vagrant 1.6.2
VirtualBox 4.3.12
That is strange. What I have is I have a folder mapped on the "folders" section from my host machine that inside contains all the sub-folders for all my projects in progress. So my nginx sites just basically link to the sub-folders inside this directory. If you have something like that it "should" show you the folders from your host inside that Code directory in your VM. Maybe post your YAML file to check it out?
My problem was the new Homestead file, use small c for spelling directory "code".
I was upgrading my homestead, so the old code folder was using capital c, spelled "Code".
I just change my Homeastead.yaml file from calling "code" to "Code".
I have a vagrant box setup running my dev code which is a nginx/php setup.
(Quick info on vagrant - its a virtualbox wrapper: http://www.vagrantup.com/).
In the vagrant/virtualbox setup, it is using linux guest additions to mount a shared folder on my host computer (MAC OSX).
linux guest path: /var/www/local
OSX host path: ~/src/
On multiple occasions, I find that php can't seem to write anything through any command (file_put_contents, fwrite.. etc) to any path location on the mounted shared folder, However it is able to write outside of the /var/www/local (for example /var/www/not-mounted/..).
I find this very difficult to work with, as I am using a cache system and it keeps failing to write any of the cache javascript/css files to (/var/www/local/public/root/cache/) which I need to be in the root folder of my website which is (/var/www/local/public/root/index.php).
I have done a lot of research on this topic:
it seems, the folder mount has the right permissions:
When I type mount command in the linux guest, I get this:
/var/www/local on /var/www/local/ type vboxsf (uid=1000,gid=1000,rw)
Clarify:
This happens all the time, it is a known problem I encounter which I try to workaround.
From cat /etc/passwd:
vagrant:x:1000:1000:vagrant,,,:/home/vagrant:/bin/bash
Can anyone help me on this?
I have figured out the problem.
I have forgot to give PHP the correct user-privileges and permissions to write to the folder. Basically, my PHP user/user-group was www-data/www-data however, vagrant has its own user/group (vagrant/vagrant) which mounts the folder /local/.
Since I did not want to mess with my vagrant mounting behaviour, I just simply changed my php config to start PHP with the user/group - vagrant/vagrant.
This fixed the issue for me.
Thanks for the help!