Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a dedicated server with multiple websites. I have created a global directory for common scripts for all websites, rather than repeating them in every website directory.

How can I make this global directory accessible for all website. I am getting following error.

Warning: require_once() [function.require-once]: SAFE MODE Restriction in effect. The script whose uid is XXXX is not allowed to access /vhosts/globallibrary/Zend/Application.php owned by uid XXXX

I have change the ownership of global directory for X website. so it works fine for X website. latter I added another website Y Now I am getting the same error again. If I change the CHOWN for Y website then X website will have the same error.

I don't want to disable the safemode restriction. Is there a work around, so that this global dir will be accessible by all website.

I am getting following error in my browser when I try to access global directory. Global directory is on same level as all other websites.

Is this a good practice to enable safemode for websites?

share|improve this question
up vote 0 down vote accepted

safe_mode_include_dir allows you to set an include directory for use in 'Safe Mode', that will (should) bypass the safe mode restrictions

But safe mode is depreciated and shouldn't be used, unless you're providing shared hosting but even then there are better ways of doing it.

share|improve this answer

I don't want to disable the safemode restriction

Why not?

There are very good reasons why it is deprecated.

Is this a good practice to enable safemode for websites?


Designing a security model goes way beyond what can sensibly be dealt with here - but PHP safemode shouldn't figure in your model.

As an interim measure you might consider storing the data in a database.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.