Current time: 11-26-2024, 10:02 AM Hello There, Guest! (LoginRegister)


Post Reply 
Custom php settings for a specific php file under document root
Author Message
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #1
Custom php settings for a specific php file under document root
Hi,

I have a directory here:
/var/www/virtual/my.domain.tld/htdocs/application

I have a php.ini file under that location, which set mbstring.func_overload = 7 globally for this directory in runtime. It is working well.
I would like to make an exception for a specific file, called rpc.php in the same directory, with this value: mbstring.func_overload = 0

So, due to that php runs as cgi, using fcgid, the normal way is not working.
Apache config:
Code:
<Location /application/rpc.php>
Order allow,deny
Allow from all
php_value mbstring.func_overload 0
</Location>
php.ini content under the directory:
Code:
mbstring.func_overload = 7
<Location /application/rpc.php>
Order allow,deny
Allow from all
mbstring.func_overload = 0
</Location>

So, I googled around but I did not find the solution for my problem.

I would like to know, is there a way to make this kind of exception for a specific php file?

Thank you,
István
Hmmm, it seems, the global php.ini settings are permanent, so, I cannot rewrite these settings in a new php.ini file under a directory, to change the setting for the specific directory....

In other words: php does not care, what I write into /var/www/virtual/my.domain.tld/htdocs/php.ini

Is there a working way, how to use different settings for directories/files?
(This post was last modified: 12-30-2008 10:52 PM by pongraczi.)
12-30-2008 10:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
simple Offline
Junior Member
**
Graph Team

Posts: 143
Joined: Dec 2006
Reputation: 0
Post: #2
RE: Custom php settings for a specific php file under document root
mbstring.func_overload is of type PHP_INI_PERDIR and cannot be set for a single file, nor can it be overridden by ini_set(). Sorry, with a standard install you cannot or should not be able to do this.

regards
Markus
12-30-2008 10:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #3
RE: Custom php settings for a specific php file under document root
Thank you very much for your help!
That was I am afraid of. I read this somewhere else.
I do not want to change back to mod_php, so, it seems, I have to drop out this application/feature.

Thanks again!
Cheers,
István
(This post was last modified: 12-30-2008 11:40 PM by pongraczi.)
12-30-2008 11:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)