Web Hosting Articles
Categories
- Web Hosting (34)
- Control Panels (13)
- Dedicated Servers (12)
- Virtual Private Servers (9)
- Unix Linux Web Hosting (8)
- MS SQL Database Servers (5)
- Domain (5)
- Email Accounts (4)
- Hardwares (3)
- Web Hosting Plan (3)
- Shared Hosting (3)
- Costing (2)
- Windows Web Hosting (2)
- Multiple Domain Hosting (1)
- Plesk Web Hosting (1)
- Managed Dedicated Servers (1)
- Reseller Hosting (1)
- Log Files (1)
- FTP Access (1)
- Ecommerce (1)
- Unlimited Hosting (1)
- Unmanaged Dedicated Servers (1)
How to change PHP memory limit in Linux server?
In this article, I have tried to explain how you can increase the default memory limit to run your PHP application. The default PHP memory limit in cPanel will be 64 MB. Users may receive below type of errors in running PHP application which require more PHP memory than default 64 MB.
You can increase the default PHP memory limit value from “PHP configuration Editor” option of WHM. You will find “memory_limit” directive in core section. Just increase the limit from 64 MB to 256 MB (or any value in MB you wish). Click on Save button to submit the changes.
phpinfo();
?>
Once you got the exact path open it with any file editor tool like vi, pico or nano. I am using vi editor and find it more comfortable. So type below command once you are in /usr/local/lib directory:
Note: I would recommend to backup the existing php.ini file before you make any changes. Since if by mistake you will mess it then it may lead to stop your PHP functioning. So simply copy existing php.ini file somewhere and then start editing the existing one.
You will find “memory_limit” directive inside “Resource Limit” section. Just modify this value to the limit you wish to set and save exising php.ini file. In vi editor Press Esc -> colon (:) -> wq to save the file.
You will need to restart your apache server in order to make the changes effective. You can restart it by executing following command through SSH:
apachectl -k restart
Simply check phpinfo.php file and make sure the changes are reflected properly.
Thanks!
Rate This Article
Add comment
Web Hosting Directory
-
The web hosting directory is for anyone who is searching for website hosting and hosting related resources. The directory is listing Shared, VPS and Dadicated server plans in descending order for customer ratings !!! This web hosting directory is listing plans on the basis of 100% unbiased customer ratings. TheWebHostingDir.com provides you nice tool to easily search all types of web hosting plans including cheap web hosting, ASP.Net hosting, php mysql hosting, Cheap VPS Hosting, Windows VPS, HyperV VPS, Xen VPS and Cpanel VPS Hosting.

Quick search
Request a Quote
If you wish to receive proposals from Web Hosting Companies Suited to your needs.



