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

php strip all tags

The below function can strip almost all tags from a string. function strip_all_tags($string) {     $string = preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $string );     $string = strip_tags($string);     return trim($string); } $a = '<script type="text/javascript" src="jquery.js"></script> <div id="test" style="padding:5px; color:red;">Hello world</div>'; echo strip_all_tags($a); // outputs: Hello world

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;         ...

htaccess disable directory browsing, disable file listing, disable file access

There may be some personal or secure data in a file, that you want to hide from the end user, when it is viewed through a web browser. Ex: http://www.example.com/user_files/24/chat.txt In the above scenario, if the file "chat.txt" contains a secure data, and you dont want to allow end users to directly access the file, or to disable the file listing in the folder "user_files" or "24", use the below code in your .htaccess file inside "user_files" folder: Options -Indexes order allow,deny deny from all