Programming

How to create symbolic links via FTP

Spoiler: you cannot!

In order to use Laravel File Storage utility, I had to create a symlink in the public folder pointing to a subfolder located in the... storage folder. That is nice and easy when you can ssh to your production server. However, it is a whole other story if you only have FTP access!

So the solution was to let PHP do the work for me, by using the handy symlink function:

if (!file_exists('./storage')) {
    symlink("../storage/app/public", "./storage");
}

Create symbolic links on server without SSH available?

Back


Comments

No comment yet.

A remark, a suggestion? Do not hesitate to express yourself below. Just be courteous and polite, please.

If this field is left blank, you will appear as Anonymous.