Skip to main content

How to edit php.ini in the cpanel

It is often required to change some settings in the php configuration of our site. If you have access to the cpanel of your hosting provider, then the below steps can help you in modifying the settings in php.ini file..... (Note: these steps are specific to hostmonster)

Step 1- Login into your cPanel.
Step 2- Under the Software/Services category, click on the PHP Config icon.
Step 3- In this screen, there is a section called Install Default php.ini. Under that section, please check mark the "IonCube" and the "SourceGuardian" check boxes (Many commercial php scripts need these turned on - if you think your script may not require the IonCube or SourceGuardian packages, it is okay to not check mark the boxes - but it will not hurt anything to check mark both boxes.).
Step 4- Under the same section, click the "INSTALL PHP.INI MASTER FILE" button.
Step 5- You have just successfully installed the "php.ini.default" file . But the next step is to rename it from "php.ini.default" to just "php.ini" to make it active. You can do the Rename in the File Manager screens. Under the Files category in your cPanel, please click on the File Manager icon.
Step 6- When you click on the File Manager icon, you should get a popup dialog titled "File Manager Directory Selection". (If you do not see the popup dialog, then you need to click on the link at the bottom of your cPanel called "reset all interface settings" - and then Refresh your cPanel and click on the File Manager icon again.) In the popup dialog screen, click the "Web Root (public_html/www)" and the "Show Hidden Files (dotfiles)." choices. Finally please click the "Go" button.
Step 7- If you already have a "php.ini", I would recommend that you Rename the file to "php.iniOld" in case you need ever need it.
Step 8- Find the file that you just installed called "php.ini.default", Right-Click the file and choose the Rename option.
Step 9- A new popup dialog called Rename should appear. Please start pressing your Backspace on your keyboard and you will start to see the letters disappear. Keep removing the letters until you see only "php.ini", and then click the Rename File button.
Step 10- Your php.ini file is now active and fully functional !! Additionally, some users need to make adjustments to this file. To edit the file, you just Righ-Click the php.ini file and choose the Edit option, and then change the value like these examples show:
a. To increase your memory for your php pages: memory_limit = 2M ---> memory_limit = 100M
or
b. To turn on your Register Globals: register_globals = Off ---> register_globals = On (We don't recommend that you change this flag unless you know what you are doing.)
or
c. To increase the maximum file size for uploading (there are two flags that you have to change):
post_max_size = 2M ---> post_max_size = 100M
upload_max_filesize = 2M ---> upload_max_filesize = 100M
Step 11- Important: The php.ini file is generally directory specific. If you have "PHP5 (Single php.ini)" or "PHP5 (FastCGI)" selected in your Php Config screen, then you should not need to do anything else. If you do NOT have either of those selected, then you may need to copy the php.ini file into all of the subfolders inside your public_html directory. This may be dozens and dozens of subfolders that you have to copy the file into. Also, sometimes it can take between 15-30 minutes before the system recognizes the php.ini file or any changes that you have made in the file.

Comments

Popular posts from this blog

Joomla validate chrono forms using jquery

It is a common practice to use Chrono forms in our joomla site to setup various forms in the site, be it a contact us form, submit a ticket form, or whatever. I have set the option "validate form" to "No" under chronoform settings in admin panel, and also preferred to not include any js or css files. For validating the chrono forms, i prefer jquery. So first lets add jquery support in our joomla. It is quite simple: 1. Download jquery.js and jquery_min.js (1.4.2 version is enough) and place them in media/system/js folder of your joomla. 2. Edit libraries->joomla->html->html->behavior.php, and add the following function below the mootools() function: function jQuery($debug = null)     {         static $loaded;         global $mainframe;         // Only load once         if ($loaded) {    ...

joomla remove category name in url

-) If anyone is using the lyftenbloggie component, and want to remove the component name and category title from the sef url, follow this hack: (Note: You also need to install the lyftenbloggie extension for ARTIO SEF) Under components/com_sef/joomsef.php, After this code: $location = array();         foreach ($title as $titlePart) {             if (strlen($titlePart) == 0) continue;             $location[] = JoomSEF::_titleToLocation($titlePart);         } Just add this code: if($location[0] == 'lyftenbloggie')         {         $temp_sef = end($location);         $location = array();            $location[] = $temp_sef;         ...

php get content between tags

This involves parsing the dom document. <?php function getTextBetweenTags($tag, $html) {     $dom = new domDocument;     @$dom->loadHTML($html);         $dom->preserveWhiteSpace = false;     $content = $dom->getElementsByTagname($tag);     $out = array();         foreach ($content as $item)     {         $out[] = $item->nodeValue;     }     return $out; } $xhtml = '<tag>abc def</tag><tag>123 456</tag>'; $content2 = getTextBetweenTags('tag', $xhtml); foreach( $content2 as $item ) {     echo $item.'<br />'; } ?> Output: abc def 123 456