PHP5, phpSuExec and php.ini override.

Serra

Well-Known Member
Oct 27, 2005
272
21
168
Florida
I'm running PHP5 and phpSuExec and I want to use php.ini overrides in my local directories. HostGator support tells me that this is impossible. (ok, fine)

Is it possible to do this or not? I've read just about every thread on this board and I've search the Internet for hours and I found no one who is having this problem outside of this forum and I don't see any one here who has the answer.

What I do know. There is one thread that points to a setting in php_ini.c, but that setting is not in my php_ini.c file. There is also a thread that talks about information in the ./configuration file, but I've searched that file and I don't see anything there that will help.


Has anyone done this?
 

Serra

Well-Known Member
Oct 27, 2005
272
21
168
Florida
No one is having this problem but me and HostGator? Someone must be... please help!
 

sparek-3

Well-Known Member
Aug 10, 2002
2,173
280
388
cPanel Access Level
Root Administrator
The way I understand it cPanel removed the feature that allowed customized php.ini files to be placed into the same directory as the PHP files and read instead of the server-wide PHP. This was removed in the latest PHP5 phpsuexec patches. I'm not absolutely certain that this is the case, but this is what I've read. I'm also not sure how this is suppose to be worked around in the new PHP5 phpsuexec. Apparently, if you are running PHP5 and phpsuexec, then you can no longer do customized PHP directive changes. They are either made server-wide or not made at all. But you would ultimately have to talk with cPanel concerning this.
 

Mysteerie

Well-Known Member
Dec 29, 2003
128
0
166
It wasn't cPanel. The developers of PHP decided that it was an undocumented feature (i.e. a bug) and simply fixed (removed) it in PHP 5.1.x and above.
 

greetingsc

Well-Known Member
May 18, 2004
45
0
156
Mysteerie,

Do you know what version specifically this was changed in, I can't find it in the PHP changelog. Thanks.

Michael
 

sparek-3

Well-Known Member
Aug 10, 2002
2,173
280
388
cPanel Access Level
Root Administrator
I believe this was removed in PHP 5.1.2.

Mysteerie may be correct. This may not be cPanel's doing. I never really read any official word on any of this. I just know that up until PHP 5.1.2 (I think) users could place php.ini files in their directories and that php.ini was read instead of the server-wide one. This is not to say that I disagree with this move. I do believe that there are security issues raised in allowing this. My main fuss is that it was there, then it was removed and never explained. Perhaps this was just one of those undocumented "features" that wasn't really acknowledged in the first place, so to disable it doesn't really require any acknowledgement either.
 

greetingsc

Well-Known Member
May 18, 2004
45
0
156
For servers running phpsuexec, where can single user php directives be set if php.ini files cannot be used (and obviously .htaccess is out since it is phpsuexec)?
 

Richie

Registered
Oct 19, 2005
1
0
151
greetingsc said:
For servers running phpsuexec, where can single user php directives be set if php.ini files cannot be used (and obviously .htaccess is out since it is phpsuexec)?
Anybody have any idea on this yet as to how users are meant to set directives?
We have just rolled out php5.1.6 and are seeing customers crying into their keyboards.!!!
 

greetingsc

Well-Known Member
May 18, 2004
45
0
156
I believe your only option is to put the directive directly in the script (using ini_set function) or to set them globablly for the server.
 

anest

Member
Sep 18, 2005
21
0
151
just try to recompile it and add something like

--with-config-file-path=.:/etc:/usr/local/Zend/etc
 

bvierra

Well-Known Member
Jul 28, 2006
55
1
158
Southern California
This is an issue with PHP 5.1 you can see it at: http://bugs.php.net/bug.php?id=38714

All of HostGators servers have been updated. If you still have an issue please open a support ticket and put it to my attention.

Billy Vierra
CIO
HostGator.com
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
I'm running PHP5 and phpSuExec and I want to use php.ini overrides in my local directories. HostGator support tells me that this is impossible. (ok, fine)
Apparently that support is filled with a bunch of morons!

You can specify custom PHP.INI files for any script or account either in
the command line for both CGI and CLI or in the httpd.conf for
all versions of PHP using phpSuExec.

If running PHP v4.x or some versions of PHP v5.x, the user can also additionally
specify their own custom PHP.INI file in the home directory of their account as well.
 
Last edited:

bvierra

Well-Known Member
Jul 28, 2006
55
1
158
Southern California
Apparently that support is filled with a bunch of morons!

You can specify custom PHP.INI files for any script or account either in
the command line for both CGI and CLI or in the httpd.conf for
all versions of PHP using phpSuExec.

If running PHP v4.x or some versions of PHP v5.x, the user can also additionally
specify their own custom PHP.INI file in the home directory of their account as well.
Before making such blanketed comments please check out my response:
This is an issue with PHP 5.1 you can see it at: http://bugs.php.net/bug.php?id=38714