Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: toothmkr57 on August 18, 2012, 09:52:51 AM

Title: php.ini
Post by: toothmkr57 on August 18, 2012, 09:52:51 AM
Hello, I have been experiencing some database connection problems with my forums, so I have been in touch with my hosting company. Their support team has come back with some changes I could make in the php.ini file.  I went in search of it, but am unable to find it.. Can someone direct me to where i might find this? Thanks :)
Title: Re: php.ini
Post by: kat on August 18, 2012, 10:26:39 AM
Most hosts won't let you near that file, oddly enough.

Where is it?

Well... it depends where php is installed, really.

Sometimes you might find it in /etc/php.ini, or you might find it in /usr/bin/php/php.ini, or, even, in /wwwroot/php/php.ini
Title: Re: php.ini
Post by: MrPhil on August 18, 2012, 10:41:20 AM
All hosts have some sort of system or global php,ini (possibly under a different name) that you can't touch. Most will let you create your own php.ini file in any of your directories, to override the global settings. Most sites do not automatically have a php.ini file, so you have to create it yourself. Also note that some servers are configured to need an entry in the .htaccess file pointing to the php.ini file, e.g.,
suPHP_ConfigPath  /home/ACCOUNTNAME/public_html
Check with your host whether this is required. They can also tell you whether they permit a php.ini file.

Define this script:
<?php  phpinfo();  ?>
and run it before and after changing php.ini. If the appropriate value changes to what you just set, you did it correctly.
Title: Re: php.ini
Post by: Sir Osis of Liver on August 18, 2012, 03:52:48 PM

If host support has recommended changes to php.ini, then you should have access to it, probably via your control panel.  It is not part of SMF - it sets server configuration to run php scripts on your account.  The reason many hosts don't allow user access to it is because you can cause serious problems, including security vulnerabilities, if you change things you shouldn't.

Title: Re: php.ini
Post by: toothmkr57 on August 21, 2012, 07:54:21 PM
OK, so the reason I couldn't find it, is... it wasn't there.  well yes/no. unless you add a custom script, it runs off of the global one... :)  I do have the ability to add my own custom, so that bares the question.  Does anyone have a custom php5.ini written for php5.3 and optimized for smf 2.x that they would be willing to share?
Title: Re: php.ini
Post by: MrPhil on August 22, 2012, 09:52:57 AM
Read my post again. You will need to ask your host if they permit you to define a php.ini file (presumably yes in your case, as support advised you to make one), and if there are any special rules for it (e.g., ConfigPath needed?). Due to different setups for different servers, other people's php.ini's are not going to be useful for you, so don't go asking for them. You need to understand what settings you need to change, and create your own php.ini.