icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Custom PHP.ini?

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old December 10th, 2005, 5:49 AM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Oct 2003
25 posts
Gave thanks: 0
Thanked 0 times
Question Custom PHP.ini?

I am pretty sure that this is possible (as far as having my own user defined php.ini file to override default settings), but where do I place this file so the PHP engine will recognize it and enforce my settings?

I tried placing it in:

/home/username/
/home/username/etc/
/home/username/public_html/

then running a php script simply calling phpinfo() and the local value and master value in the core settings show exactly the same everytime. My conjecture is that if my settings are enforced, then the local values should differ from the master values. Am I correct?

Mainly, I want to set my PHP environment such that it is production grade (no register_globals on, and things of that nature), but I also want to be able to revert those changes quickly if necessary (e.g. for development), so I am assuming this is what a user defined php.ini will do.

Lastly, is there a way to enforce those user defined PHP.ini settings on certain directories, or is it an all or nothing (meaning once set, then PHP will enforce it only say in folders '/home/username/public_html/myproductionphp/' verus the entire domain)? I would rather prefer the latter, but thought I would ask.

Thanks

Last edited by codergent; December 10th, 2005 at 5:50 AM. Reason: Indicate the topic question is a question rather than an informative
codergent is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 10th, 2005, 10:06 AM   #2 (permalink)
Surpass Fan
On a golden path...
 
Joined in Nov 2003
432 posts
Gave thanks: 0
Thanked 0 times
If php is running as an apache module, PHPSuEXEC not enabled, it is possible to override php.ini settings in .htaccess

http://www.karakas-online.de/EN-Book...arameters.html
__________________
Fw Web Solutions
http://fwwebs.com
fwwebs5 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 12th, 2006, 1:34 PM   #3 (permalink)
Registered User
Fresh Surpasser
 
Joined in Oct 2003
25 posts
Gave thanks: 0
Thanked 0 times
Thanks that did it. Here's an example.

In .htaccess
Code:
php_value register_globals Off
If used, the local value will differ from the master value when viewed in phpinfo(). Also if you place this .htaccess file in say /home/username/public_html/, the register_globals value is in effect across the entire web site, say in public_html's subfolders. If you wish you only have register_globals only apply to certain (sub) folders, one should only include the .htaccess file in those folders
codergent is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 16th, 2006, 6:12 AM   #4 (permalink)
Registered User
Fresh Surpasser
 
Bugs's Avatar
 
Joined in Oct 2005
Hosted on SH86
22 posts
Gave thanks: 1
Thanked 0 times
Quote:
Originally Posted by fwwebs5
If php is running as an apache module, PHPSuEXEC not enabled, it is possible to override php.ini settings in .htaccess
coderagent, if you search 'bugs' there's been some research on this already. I'm using an php.ini override with PHPSuEXEC enabled (not as apache which kayla says is more secure) and if your running Vbulletin the .ini file is placed in your admincp directory . . .

Whatever works, Just 2 cents!!
__________________
SH86 (IP 72.29.83.114)
<a href="www.deltaxchange.com"> The PirateXchange</a>

Last edited by Bugs; January 16th, 2006 at 6:15 AM.
Bugs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On