php.ini and override default php.ini

Status
Not open for further replies.

areh

Active Member
Jul 26, 2002
44
0
156
I´m running a system with phpSuexec. I try to activate register_globals for one directory.

Since this is a cgi setup, I can only override this setting from php.ini on a per dir basis, and not through .htaccess or in httpd.conf.

However: The php.ini file I have put in the directory, beside a test.php file with phpconfig(); content, doesn´t change register_globals. So, is there anywhere a directive that allows override like this? The php settings doesn´t change.
 

rustelekom

Well-Known Member
PartnerNOC
Nov 13, 2003
290
0
166
moscow
you should recompile your php with option where php should find php.ini (i do not remember definately, so please read ./configure --help in php source folder). By default new version of php used only one - server php.ini
 

linux7802

Well-Known Member
Dec 14, 2007
232
1
68
cPanel Access Level
Root Administrator
Solution

As you mentioned you are running phpSuexec server due to that YES you can only enable or disable the function directory base.For further please read following thread

For example if you want to enable the register_globals for domain name test.com then you need to be create php.ini file under the public_html with the content "register_globals = On".It will enable the register_globals for that domains public_html folder only.

If your script installed under the public_html i.e public_html/test folder which required the register_globals enabled then you also need to create new php.ini file with the content "register_globals = On" to enable it for the entire folder public_html/test. Because php.ini file is working on directory basis and each directory required its own php.ini file to change the php values.

If you are not able to change the values by using php.ini in that case I like to recommend you to recompile the php on your server or try to disable the phpsuexec from your WHM >> Main >> Service Configuration >> Apache Configuration and select "dso" for "PHP 5 Handler" and try to enable the disable the php values by using .htaccess file
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
I´m running a system with phpSuexec. I try to activate register_globals for one directory.

Since this is a cgi setup, I can only override this setting from php.ini on a per dir basis, and not through .htaccess or in httpd.conf.

However: The php.ini file I have put in the directory, beside a test.php file with phpconfig(); content, doesn´t change register_globals. So, is there anywhere a directive that allows override like this? The php settings doesn´t change.
Are you certain you are running phpSuExec?

I get the impression you may actually be running the newer SuPHP which
operates similar to the old phpSuExec but not exactly the same and
there are differences in how you do configuration overrides.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
I´m running a system with phpSuexec. I try to activate register_globals for one directory.

Since this is a cgi setup, I can only override this setting from php.ini on a per dir basis, and not through .htaccess or in httpd.conf.

However: The php.ini file I have put in the directory, beside a test.php file with phpconfig(); content, doesn´t change register_globals. So, is there anywhere a directive that allows override like this? The php settings doesn´t change.
Are you certain you are running phpSuExec?

I get the impression you may actually be running the newer SuPHP which
operates similar to the old phpSuExec but not exactly the same and
there are differences in how you do configuration overrides.
 
Status
Not open for further replies.