IT & networking / 3 MIN READ
Changing ini.php Settings
Modifying PHP configuration settings via ini.php
From the original Fervor library. Examples may use older package versions.
Changing settings in the php.ini file using cPanel and WHM is a common task for many web administrators. Let’s walk through it step-by-step with a sprinkle of humor to keep it interesting.
Step-by-Step Guide: Changing php.ini Settings via cPanel and WHM
Step 1: Access WHM (Web Host Manager)
- Log in to WHM:
- Open your web browser and enter your WHM URL (typically something like
https://yourdomain.com:2087). - Log in with your root or reseller account credentials. If you don’t know these, you might need to chat with your hosting provider.
- Open your web browser and enter your WHM URL (typically something like
Step 2: Navigate to MultiPHP INI Editor
-
Find the MultiPHP INI Editor:
- Once logged in, look at the left sidebar menu. You can either scroll down to find “MultiPHP INI Editor” or use the search bar at the top.
- Click on “MultiPHP INI Editor.”
Step 3: Select the PHP Version and Domain
-
Choose Your Configuration:
- You’ll see two tabs: “Basic Mode” and “Editor Mode.”
- Start with “Basic Mode” for easier settings adjustments. Select the PHP version and the domain you want to configure from the drop-down menus.
Step 4: Adjust Settings in Basic Mode
-
Modify Your Settings:
-
In Basic Mode, you’ll see a list of common PHP settings you can tweak. For example:
- memory_limit: Controls how much memory a script can use. Increase it if you’re running into memory issues.
- upload_max_filesize: Maximum file size for uploads. Handy for handling larger files.
- post_max_size: Max size of POST data, which includes file uploads.
-
Simply change the values to what you need. For example, to change the
memory_limitto 256M, you’d enter256M.
-
Step 5: Save Your Changes
- Save Your Configuration:
- After adjusting the settings, scroll down and click the “Save” button. Voilà! Your settings are updated.
Step 6: Advanced Tweaks (Optional)
-
For Advanced Users - Editor Mode:
- If you need to make more granular changes, switch to “Editor Mode.” Here, you can manually edit the
php.inifile. - Be cautious and ensure you know what each directive does before changing it. Incorrect settings can break your website.
- If you need to make more granular changes, switch to “Editor Mode.” Here, you can manually edit the
Step 7: Verify Changes
- Check if Your Changes Worked:
- Create a simple PHP info file to verify changes:
<?php phpinfo(); ?> - Upload this to your web server and access it via your browser (
https://yourdomain.com/phpinfo.php). Look for the settings you changed to confirm they’ve been applied.
- Create a simple PHP info file to verify changes:
Bonus Tips
- Backups Are Your Friend: Always back up your
php.inifile before making changes. It’s like a safety net for your website. - Documentation: Refer to the official PHP documentation for a detailed explanation of each setting.
And there you have it! Changing your php.ini settings in cPanel WHM is as easy as pie (or maybe PHP?).
Happy tweaking! 🛠️😊