Custom php.ini stopped working


#1

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 its default php.ini as if this custom version doesnt 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? Ive done everything in my power to troubleshoot it, with dreamhost the only ones with access to the servers config I cant do any more.

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

Thanks in advance.


#2

Are you on VPS?

Maximum Cash Discount on any plan with MAXCASH


#3

Yep on a VPS.


#4

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

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

Set permissions for ini.cgi:

[color=#00CC00]$[/color] chmod 0700 /home/[color=#CC0000]user[/color]/[color=#CC0000]domain.com[/color]/cgi-bin/ini.cgi

In domain.com/.htaccess:

Replace: Action php-cgi /cgi-bin/[color=#CC0000]php.cgi[/color]

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

Maximum Cash Discount on any plan with MAXCASH


#5

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 its using the servers copy of php so I dont need a cron job to keep it updated.

Thanks again sXi, your a star :slight_smile:


#6

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?


#7

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/

Maximum Cash Discount on any plan with MAXCASH


#8

“Are you on VPS?”

Will a custom php.ini only work on vps?


#9

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

Maximum Cash Discount on any plan with MAXCASH


#10

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


#11

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?

Maximum Cash Discount on any plan with MAXCASH


#12

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()


#13

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.

Maximum Cash Discount on any plan with MAXCASH


#14

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?


#15

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.

Maximum Cash Discount on any plan with MAXCASH