Anonymous 0


I'm working on a CMS of mine and I want to use a central library for all clients using it. This would have the advantage that bug fixes and updates can be done at a central point for all clients at once. I know someone who does the same and he told me he simply included the library on each domain from a parent directory with PHP.

I have now tried the same thing but it won't work on my host, this has raised some questions of mine:

Is this something that many hosting providers provide? Is this configurable in the apache config? If this would be default at some hostings, couldn't it be considered a security leak since this would provide clients the option to access root directories of the reseller?

I hope someone could help me with this.

Thank you in advance :)

3 answers


Hi there, try for programming related questions, this site is is more about HTML/CSS/JS.



Answered almost 9 years ago by Marko Ivanovski

If you have root access and can modify your own php.ini file, then you can change PHP's security settings. If you don't, then you can't.

Answered almost 9 years ago by Nathan Duran

Provided your server is running on Linux, you can create symbolic links to the library from within the domain root to a common location (the target location still needs to be readable by all your PHP processes, though). For this to work you probably need shell access (e.g. via ssh). This will not work if you use a regular shared hosting package.

If you want this level of control over your web server, you probably want a VPS, i.e. a virtual server with full root access. This obviously requires a more sophisticated knowledge of the inner workings of a server unless your hosting company provides some kind of managed server plan (these are usually very expensive).

Depending on the exact nature of your problem there are two simple solutions, though:

  1. If you are using the full path to the location of the common library and the problem lies in the permissions, you can try giving everyone read-access to the library files (every FTP client should let you do this -- don't mess with the write-permissions though).
  2. If you can't access the location of the common library at all, you can simply keep a copy of the library in each client's home/root folder. This will make updates more painful, though, but may be the only way to go if you don't have access to any location outside the clients' subtrees.
Answered almost 9 years ago by Alan Plum