In what scenarios would increasing PHP memory limits be a viable solution to memory exhaustion errors in scripts?

Memory exhaustion errors in PHP scripts occur when the script reaches the memory limit set by PHP, resulting in the script being unable to allocate more memory. Increasing the PHP memory limit can be a viable solution to this issue, allowing the script to allocate more memory and potentially prevent memory exhaustion errors.

ini_set('memory_limit', '256M');