I succesfully deployed a Laravel website onto a web server by cloning it into a directory at the same level as public_html (called laravel) and creating a symlink to the laravel/public directory into public_html, with this command:
ln -s laravel/public public_html
This works great.
Now I want to have a "test" version of the site for development, and I wanted to do the same.
- I cloned my project in a "laravel_dev" directory, same level as public_html and laravel directories.
- I created a public_html/dev directory.
- Now, I want to create a symlink of 'laravel_dev/public' into 'public_hmtl/dev' and here is where I am having trouble.
If I do
ln -s laravel_dev/public public_html/dev
It creates a file (not a directory) called public inside public_html/dev.
I tried making the target go to laravel/public/dev, with the same result. I double checked that laravel_dev/public directory exists and it is not empty. I also tried removing the dev directory inside laravel/public/dev, and the result there is that it creates a file called dev inside laravel/public but it is not a directory.
To clarify, my directory tree is something like this:
www
|___public_html(1)/dev
|___laravel/public(1*)/dev
|___laravel_dev/public
I am positioned in www directory when I am executing the mentioned commands The (number) indicates symlink and the * indicates the "physical" directory. Using this notation here is what I want to acomplish:
www
|___public_html(1)/dev(2)
|___laravel/public(1*)/dev(2)
|___laravel_dev/public(2*)