custom php.ini stopped working

custom php.ini stopped working

Posted by: crofty
Posted on: 2008-10-24 03:51:00

About a year ago I setup a custom php.ini as per the steps in the wiki: http://wiki.dreamhost.com/PHP.ini which btw have since changed, they used to be the same as posted here http://drupal.org/node/113220 (looks like drupal copy pasted from dreamhost or vice versa)

The other day this custom version stopped working, the server is just using it`s default php.ini as if this custom version doesn`t exist. After seeing that the steps in the wiki had changed I went through them again, but still no luck.

I suspect it`s a change/missconfiguration on dreamhosts part, but support just refuse to help and directed me here.

So, any ideas? I`ve done everything in my power to troubleshoot it, with dreamhost the only ones with access to the servers config I can`t do any more.

I`m kind of stuck, any help much appreciated!

Thanks in advance.

Re: custom php.ini stopped working

Posted by: sXi
Posted on: 2008-10-24 13:12:00

Are you on VPS?


Re: custom php.ini stopped working

Posted by: crofty
Posted on: 2008-10-24 14:08:00

Yep on a VPS.

VPS php.ini fix

Posted by: sXi
Posted on: 2008-10-24 14:35:00

Create file ini.cgi in your cgi-bin folder with these contents:

#!/bin/sh
export PHPRC=/home/user/domain.com/cgi-bin
exec /home/user/domain.com/cgi-bin/php.cgi


Set permissions for ini.cgi:

$ chmod 0700 /home/user/domain.com/cgi-bin/ini.cgi


In domain.com/.htaccess:

Replace: Action php-cgi /cgi-bin/php.cgi

With: Action php-cgi /cgi-bin/ini.cgi


Re: VPS php.ini fix

Posted by: crofty
Posted on: 2008-10-24 17:29:00

Thanks sXi, using what you posted I was able to get it working.

I added this to php-wrapper.cgi

#!/bin/sh
export PHPRC=/home/[user]/[domaion.tld]/cgi-bin
exec /dh/cgi-system/php5.cgi $*

Seems to be working fine and I think it`s using the servers copy of php so I don`t need a cron job to keep it updated.

Thanks again sXi, your a star :)

Re: VPS php.ini fix

Posted by: confused
Posted on: 2008-10-27 01:21:00

This was great got my custom php.ini working again WOOHOO!

But now my subdomains dont don't use the custom php.ini. Darnit!
How would I get bit working for the subdomains?

Re: VPS php.ini fix

Posted by: sXi
Posted on: 2008-10-27 06:10:00

If your subs are in the form sub.domain.com you can run this in any of them in which you want a custom php.ini

http://sxi.sabrextreme.com/files/dh-phpini/



Re: custom php.ini stopped working

Posted by: Akyhne
Posted on: 2008-11-04 16:01:00

"Are you on VPS?"

Will a custom php.ini only work on vps?

Re: custom php.ini stopped working

Posted by: sXi
Posted on: 2008-11-04 19:43:00

You can setup a php.ini file to edit (or even compile your own php) on any DH server.


Re: custom php.ini stopped working

Posted by: Akyhne
Posted on: 2008-11-05 01:19:00

I already did, but as a lot others, it doesn't seem to work. My phpinfo still says I'm using the ini file from the /etc/* folder

Re: custom php.ini stopped working

Posted by: sXi
Posted on: 2008-11-05 01:28:00

Well I'll maintain you can setup a php.ini or even completely customise your own php environment on any DH server.

Did you first try an install as described in the Wiki?


Re: custom php.ini stopped working

Posted by: Akyhne
Posted on: 2008-11-05 02:36:00

I did exactly as described here: http://wiki.dreamhost.com/PHP.ini

I have no errors, it just doesn't work.

Conf. file says /etc/php5/cgi
Loaded Configuration File says /etc/php5/cgi/php.ini
in phpinfo()

Re: custom php.ini stopped working

Posted by: sXi
Posted on: 2008-11-05 10:46:00

First undo whatever it is you've done. That could include deleting your cgi-bin folder and removing any edits the Wiki instructed you to make to your .htaccess file. Then run the script linked above.


Re: custom php.ini stopped working

Posted by: Akyhne
Posted on: 2008-11-05 11:36:00

I just got it to work with this link: http://discussion.dreamhost.com/showthreaded.pl?Cat=0&Board=forum_troubleshooting&Number=110438&page=&view=&sb=&o=&vc=1#Post110438

Although I had to copy the php5.cgi file instead.

But how do I then get it to work on my subdomains? Just the same procedure?

Re: custom php.ini stopped working

Posted by: sXi
Posted on: 2008-11-05 21:58:00

If the subdomains haven't been corrupted with bad edits, simply run the script linked above. If you've already tried to apply Wiki on them then follow the previous advice or disregard it entirely, it's up to you.



Tags: thanks in advanceinidreamhostservers