Page 1 of 2

Custom php.ini in cg directory

Posted: Mon Dec 24, 2012 8:50 am
by jmoran
Hi anyone, I have several Joomla 2.5.8 sites loaded on several Sonic accounts. They, the Joomla sites, require me to be able to use a customizable php5.3. That's because I'm loading RSFirewall for extra protection. For three of them I have gone through the customized "ln -s" described on the Wiki page process link, with the copy php.ini customizable being lodged in the cgi directory. Joomla recognizes the location and all is great. Except for one. For a reason I cannot fathom on this one site, with no difference in the CMS, it refuses to recognize the custom link. There is nothing different from the others in terms of Joomla or any other interfering files. In fact I decimated all files in my cgi-bin and now only have the php.ini and the ref file php53.

I'm using mySQL 5.5 on all the sites. I have loaded and dropped the tables, then reloaded a fresh copy of Joomla three times in case there was a problem, I have checked the .htaccess file for any deviation from the ones that operate correctly but still the site doesn't not recognize the custom php.ini. If I delete my username direction in the Action line, it recognizes php53 but then it isn't customizable because it's the public version. Action php-cgi /cgi-bin/MYUSERNAME/php53 AddHandler php-cgi .php

As I say this process works on the other duplicate set ups on different accounts but not on this one. I haven't got enough hair to pull out to understand why this is happening. Any help or suggestions would be greatly appreciated. Cheers.

Re: Custom php.ini in cg directory

Posted: Wed Dec 26, 2012 12:14 pm
by joemuller
If the php.ini file isn't applying, try using the .user.ini file as outlined at the post below:
viewtopic.php?f=8&t=761&p=4475&hilit=php.ini#p4475

I've found the latter approach of .user.ini to work quite well in corner cases like these.

Re: Custom php.ini in cg directory

Posted: Wed Dec 26, 2012 1:08 pm
by jmoran
Cheers Joe. I'll give it a try. Thanks for replying.

Re: Custom php.ini in cg directory

Posted: Wed Dec 26, 2012 1:20 pm
by jmoran
.....just a quickie Joe, should I place the .user.ini file in my cgi-directory or in the web root directory of the Joomla site?

Re: Custom php.ini in cg directory

Posted: Wed Dec 26, 2012 1:52 pm
by joemuller
You'll want to put .user.ini in the web root for your site.

Re: Custom php.ini in cg directory

Posted: Wed Dec 26, 2012 2:58 pm
by jmoran
Cheers mate!

Re: Custom php.ini in cg directory

Posted: Wed Dec 26, 2012 3:38 pm
by jmoran
Joe, the .user.ini file in the web root worked with 'open_basedir' but not with being able to 'allow_url_fopen = Off' or 'disable_functions = XXXXX XXXXXX etc'. Should I remove the php.ini file from the web root as Sonic doesn't even allow it's use from there? Any ideas? Don't want to bother you too much. If you fancy access to the directories, no problem. John

Re: Custom php.ini in cg directory

Posted: Thu Dec 27, 2012 6:27 pm
by joemuller
If you have a php.ini for all your sites, leave that one as-is. But yes, you'll want to just have the .user.ini file instead of the php.ini in the web root for your site.

Re: Custom php.ini in cg directory

Posted: Mon Dec 31, 2012 4:24 pm
by jmoran
Still no luck Joe. As I say. Three separate accounts with sonic with various domains, all with php.ini files in cgi-bin. One works fine, beautifully with all the customized variables and the two others will not recognize the cgi-bin php.ini. It's 5.3 I'm directing the .htaccess to. I've tried the .user.ini file in every place possible in the two accounts that are troublesome and that doesn't work either, except for the "open_basedir" variable and I'm beginning to think that's a freak bit of luck. The Add Handler in the .htaccess will only work for the troublesome sites if I take out my username in the url which of course then doesn't allow me to make changes in either of the php.ini fles that will have an effect,

As I say, to my knowledge, and I'm not that knowledgeable as you can tell, there is nothing that should prevent the Add Handler direct to my personal php.ini file in the two other sites cgi-bins. The troublesome accounts are my own and the one that gives me no trouble is for the company I work for. It's a mystery.

Re: Custom php.ini in cg directory

Posted: Wed Jan 02, 2013 7:51 pm
by jmoran
Anyone else got any ideas? Could it be something to do with the cgi-directories directory themselves?