Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bngaard's avatar

create_symlink on shared hosting

Hi guys, I am sure this question has been raised a billion times, but I am struggling to find a solution to the problem. I want to deploy a project on a shared hosting service (one.com) and following this guide -> . I know there are several good (and much better) alternatives and just as many reasons for not using shared hosting, but this server is already paid for and up&running for other purposes and I don't want to spend money on additional hosting.

I have been following this guide https://dev.to/fractalbit/deploy-a-laravel-7-app-to-shared-hosting-4eac, but are now stuck. All files are uploaded but my symlink is causing trouble.

Warning: require(/customers/f/4/8/DOMAIN_NAME_DELETED/httpd.wwwhttpd.private/vendor/autoload.php): failed to open stream: No such file or directory in /customers/f/4/8/DOMAIN_NAME_DELETED/httpd.www/index.php on line 37 Fatal error: require(): Failed opening required '/customers/f/4/8/DOMAIN_NAME_DELETED/httpd.wwwhttpd.private/vendor/autoload.php' (include_path='.:/usr/share/php') in /customers/f/4/8/DOMAIN_NAME_DELETED/httpd.www/index.php on line 37

create_symlink.php looks like (I have tried using different path's, but it always starts searching from httpd.www folder)

Finally my file structure on the server looks like -server root - Httpd.private -App -bootstrap -config -database -resources -routes - -Httpd.www -index.php -create_symlink.php -tmp

If anyone has made it so far - my question is simply

  1. Can anyone tell me how to between files from httpd.www to httpd.private
  2. Does anyone have a suggestion for alternative solution i.e. other guide. I have done my own googling, but I most links refer back to the guide I am already using.
0 likes
3 replies
jlrdw's avatar

If a symlink doesn't work just serve them from an img folder under public.

Note, store them there as well.

Or serve them via a script: see https://laravel.io/forum/04-23-2015-securing-filesimages

In fact I don't even store most images in web folders, I store somewhere else on file system.

Also for a private secure image, you can have the user id to verify it's them.

image name ann145789_127.jpg

And write a function that gets the 127.

Then if logged in user id = 127 show image, otherwise don't show image. Of course handle a message to un-authorized user however you want to.

bngaard's avatar

Hi jlrdw,

I don't understand this solution, I want to deploy a whole project, would all files be accessable if stored under httpd.www folder? How do I then ensure login credentials (ENV file) for the data tables and so on are not accessed?

jlrdw's avatar

You have to make public your document root.

Or install Main laravel above public_html.

Also see the chapter in the documentation on deployment.

Also wasn't you referring to images. If not sorry I misunderstood. Usually symlink questions are usually asking about images and documents.

Please or to participate in this conversation.