What are the best practices for adjusting resource limits in the php.ini file to prevent server overload?

To prevent server overload, it is important to adjust resource limits in the php.ini file. This can include setting limits for memory usage, maximum execution time, and maximum file upload size. By carefully adjusting these limits, you can ensure that your server can handle the demands of your PHP scripts without becoming overloaded.

; Adjust memory limit
memory_limit = 128M

; Adjust maximum execution time
max_execution_time = 60

; Adjust maximum file upload size
upload_max_filesize = 10M