News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

php.ini

Started by toothmkr57, August 18, 2012, 09:52:51 AM

Previous topic - Next topic

toothmkr57

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

kat

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

MrPhil

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.

Sir Osis of Liver


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.

When in Emor, do as the Snamors.
                              - D. Lister

toothmkr57

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?

MrPhil

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.

Advertisement: