Symlink access

njitram

Verified User
Joined
Nov 12, 2015
Messages
7
I have a folder with php libraries and other helper functions. This directory should be accessible for every website.
So i have uploaded the directory to /var/www/html named libs (/var/www/html/libs)
I want to symlink this folder to every created user, so my first question is how?
I tryed to make a symlink in one of the websites but it keeps saying "Symbolic link not allowed or link target not accessible", how can i solve these problems?

Thank you in advance
 
Hello,

Using of symlinks with disabled ownermatch is a high risk for your server security.

Put the files into /usr/local/php55/lib/php/custom/
A correct path you can find with:

Code:
php -i | grep include_path

then you can include the files as usual.

If for any reason you need to have shared files in public_html, you'd better use mount -o bind
 
Hello zEitEr,

thank you for your tip, i used your tip and pulled my project inside "/usr/local/lib/php". I also had to change the ownership to webapps to make it work, is it still save?
And is this the safest location for all other libraries, so that they cannot harm any other files?
 
You're welcome. This is a place from where the files can be easily included by most users. I don't know how secure your PHP scripts are so I do not know whether or not they can be used for harm.
 
Back
Top