How to fix “This site/page has used all available php / apache processes”?
When you are browsing your website, you may see the error message shown above. This error message appears when your website has used up all PHP/Apache processes that have been allotted.
To continue using your website, wait 5-10 seconds, then reload the page. If you continue to get the error, read on to the next sections to better understand PHP Processes and how to reduce them.
What are PHP/Apache Processes?
PHP Processes are used to measure the amount of resources that are being used to load the given page. Every request that a PHP file makes uses a PHP process (For example, if your PHP script calls two image files, three processes are used. One for the PHP file, and two for the images). A PHP process is in use the entire time that resource is loading, or parsed by the PHP interpreter. (For example, if your PHP script takes one second to load, the PHP Process will be in use for one second).
Note that PHP Processes are used for the entire website, not just one visitor. So if your PHP script uses 5 processes, and you have three visitors load your website at the exact same time, 15 PHP Processes are in use. Lastly, PHP processes are only used with PHP files. For example, if you have an HTML file that calls five images, no PHP processes are used. However, the images and HTML file all count as 6 Apache processes.
How to reduce PHP Processes
To help prevent this error in the future, you can do the following:
- Reduce the amount of files needed to load the page (Less images, less
require() or include() functions)
- HTML files do not use PHP Processes, so convert your PHP files to HTML files if you can
- Speed up the loading time of the page, so the process is available to other users quicker
- Remove or reduce background activity that requires the server, such as AJAX requests
- Use lazy-loading for images (Prevent every file from being called at one time)
If none of the above work for you, upgrade your site to premium hosting.