943,723 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 97321
  • PHP RSS
Feb 10th, 2005
0

Disabling PHP Safe Mode for a specific directory

Expand Post »
Does anyone have an example of how to disable PHP Safe Mode for a specific directory? My PHP is configured as an Apache module.

Thank you
Similar Threads
sea
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sea is offline Offline
1 posts
since Feb 2005
Feb 11th, 2005
0

Re: Disabling PHP Safe Mode for a specific directory

you can use .htaccess

just put a .htaccess file in that dir then the content of the .htaccess file should be:

PHP Syntax (Toggle Plain Text)
  1. php_value safe_mode "1"
search for .htaccess on this page: http://ca3.php.net/manual/en/function.ini-set.php for more help
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
Feb 15th, 2008
0

Re: Disabling PHP Safe Mode for a specific directory

or on the php.ini file which you upload to the directory enter this command:

safe_mode = Off
Reputation Points: 10
Solved Threads: 0
Newbie Poster
visio is offline Offline
19 posts
since Jan 2007
Feb 15th, 2008
0

Re: Disabling PHP Safe Mode for a specific directory

Click to Expand / Collapse  Quote originally posted by visio ...
or on the php.ini file which you upload to the directory enter this command:

safe_mode = Off
You bumped into a 2 year old dead thread.
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Feb 15th, 2008
0

Re: Disabling PHP Safe Mode for a specific directory

it is an old thread, but it is quite active in google, I was searching the web for " disabling safe mode for a directory " and this post is the first in google, and I think the solution given by Gary King:
php_value safe_mode "1"
is wrong, I think that probably will enable and not disable safe mode, that is why I've added my two pence.
Last edited by visio; Feb 15th, 2008 at 8:52 pm. Reason: google url
Reputation Points: 10
Solved Threads: 0
Newbie Poster
visio is offline Offline
19 posts
since Jan 2007
Feb 15th, 2008
0

Re: Disabling PHP Safe Mode for a specific directory

ah! ok.
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Oct 3rd, 2008
0

Re: Disabling PHP Safe Mode for a specific directory

I tried everything mentionned above to disable the safe_mode of PHP but it still appears On for my local directory in which I execute phpinfo()

My settings:
PHP version:5.1.6
OS: Linux Cent OS
Apache 2.0

What I did:
in the php.ini:
PHP Syntax (Toggle Plain Text)
  1. safe_mode=Off

in the .htaccess of my local directory
PHP Syntax (Toggle Plain Text)
  1. php_flag safe_mode off

in the httpd.conf
PHP Syntax (Toggle Plain Text)
  1. <Directory " /var/www/vhosts/mydomain/httpdocs/mylocaldirectory">
  2. php_admin_flag safe_mode off
  3. </Directory>

What i see in phpinfo:
Directive---------Local Value---------------------------------------------Master Value
safe_mode------On-------------------------------------------------------Off
open_basedir---/var/www/vhosts/mydomain/httpdocs:/tmp----no value

I would also like to clear the local value of open_basedir
i have set already set in my php.ini :
PHP Syntax (Toggle Plain Text)
  1. open_basedir=
Reputation Points: 10
Solved Threads: 0
Newbie Poster
franzinho is offline Offline
1 posts
since Oct 2008
Feb 11th, 2011
0

Still a problem

Anyone found a solution to this?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
karmafunk is offline Offline
1 posts
since Feb 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: How to use API in php
Next Thread in PHP Forum Timeline: pls help me..





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC