Search code examples
phpzend-frameworkzend-framework2hard-drive

How to show in my webpage files that are stores in different hard disks?


I need to show information in my webpage built using PHP Zendframework that is stored in a server that has several hard disk.

So, I need to know how I can make accessible files that are in a different hard disk than the one in which the app is working (same server).

Normally you do something like /public/files/myfile.doc but you always are in the directory where the webpage is located. How can I do to have the same behavior but for files that are in different disks than the app?

Thanks.


Solution

  • This post is not related to Zend Framework 2, just general linux filesystem issue. Can be solved with symlinks easy, just link any folder (with read access for web-server user) to /public:

    ln -s /folder1 /public
    

    or any /public subfolder:

    ln -s /mnt/other_disk/folder2 /public/folders