Shared Server? Want to change PHP.ini? Here’s how.

Post Update:

After spending some more time looking into this, I discovered another WordPresser with a pretty neat solution that is a little more flexible than my original post below. Check out this link http://selectall.wordpress.com/2007/11/01/how-to-change-php-configuration-on-public-shared-server/

Original Post:

Well sort of. Our small business clients all use shared hosting and more often than not, each different hosting company have their php.ini files setup differently. This can lead to a lot of headaches but there is some relief. In some cases, you can actually use a PHP function called ini_set() to overwrite the current value which has been pre-defined by the host. Unfortunately, only some values are changable… but that’s better than none, so here’s how you do it.

//Change the SMTP Port set in PHP.ini
ini_set(‘smtp_port, ’2525′);

Obviously, if you’d rather change the setting of “output_buffering”, “safe_mode” or “registered_globals”, just substitute where applicable. Also, keep in mind that not all variables can be changed. In my situation, I still wasn’t able to switch “off” registered_globals.