What is the PHP memory limit?
PHP is the language that runs many websites, such as WordPress. Each PHP page can only use a set amount of memory (the short-term space a computer uses while working). That cap is the memory limit.
If a page needs more than the cap, you may see an error like "Allowed memory size exhausted". Raising the limit can fix it.
The .htaccess file is a small settings file for the Apache web server. It sits in your website folder. The dot at the start means it is hidden by default.
Before you start
Back up your .htaccess file. A wrong line can make your site show a 500 error.
Steps
- Log in to your hosting control panel. The login details are in your Hostvento welcome email.
- Open File Manager.
- Go to your website folder. This is often called
public_html. - Turn on the option to show hidden files, if you cannot see
.htaccess. - Right-click
.htaccessand choose Download to keep a backup copy. - Right-click it again and choose Edit.
- Add this line at the very bottom:
php_value memory_limit 256M
This sets the limit to 256 megabytes. You can use another number, such as 128M or 512M.
- Click Save Changes.
- Reload your website to check that it still works.
If you get a 500 error
Some servers run PHP in a way that does not allow php_value in .htaccess. Your site then shows a 500 error.
- Open
.htaccessagain and delete the line you added. - Save the file. Your site should work again.
- Use another method instead. Many control panels have a PHP settings page where you can change
memory_limit. Or create aphp.inifile with this line:
memory_limit = 256M
You can also ask Hostvento support to change it for you.
Quick recap
- The memory limit caps how much memory one PHP page can use.
- Back up
.htaccessfirst. - Add
php_value memory_limit 256Mat the bottom and save. - If the site shows a 500 error, remove the line and use
php.inior the PHP settings page instead.