βš™οΈ
Hosting

php.ini Settings: Tuning PHP Configuration

08.01.2030
← All articles

php.ini is PHP's main configuration file, defining how PHP behaves on the server. It has hundreds of parameters, but for most web projects 10-15 core settings suffice. In cPanel you access it via "MultiPHP INI Editor" or "Select PHP Version".

Most important parameters

memory_limit β€” the maximum RAM one PHP script can use. Default: 128M. Recommended: WordPress 256M-512M, large e-commerce 512M-1G. Low values cause "Fatal error: Allowed memory size exhausted".

upload_max_filesize β€” the largest file size you can upload. Default: 2M. If you upload videos or large images, set 64M or 128M. For media sites 256M.

post_max_size β€” the maximum POST request size. Must be β‰₯ upload_max_filesize. Recommended: 64M-256M.

max_execution_time β€” the maximum seconds a PHP script can run. Default: 30. Recommended: 60 for normal sites, 300-600 for heavy imports or backups.

max_input_time β€” the maximum seconds allowed for receiving POST or GET data. Recommended: 60-300.

max_input_vars β€” the number of variables allowed in one request. Default: 1000. WordPress with large forms may need 3000-5000.

Display and errors

display_errors β€” whether to show errors on the page. Off in production, On in development. error_reporting β€” which error levels to show: E_ALL (everything) or E_ERROR | E_WARNING (only critical). log_errors β€” write errors to a log file. Recommended: always On. error_log β€” path to the log file, e.g., /home/user/logs/php-error.log. PHP writes all errors here β€” essential for debugging.

Time and language

date.timezone β€” server time zone. For Uzbekistan: Asia/Tashkent. Without this you get "Warning: date(): It is not safe to rely on the system's timezone settings". default_charset β€” UTF-8 is the right choice.

OPcache (caching) β€” separate article

opcache.enable, opcache.memory_consumption, and other settings significantly speed up PHP. See the dedicated [[opcache-php-tezlik]] article.

Sayt.uz practice

Sayt.uz tariffs ship with defaults: memory_limit 256M, upload_max_filesize 64M, max_execution_time 60. Premium tariffs use 512M and 128M. If clients want custom settings, they change them in cPanel MultiPHP INI Editor or ask us. Tip: in php.ini "more is better" isn't always true β€” lower values force well-behaved code. Start small, raise as needed.

Related articles

πŸ’° Hosting Price Comparison: Uzbek and International Providers πŸ“‘ Server Monitoring Tools: Prometheus, Grafana, Datadog, and More 🌐 Edge Computing Hosting: Moving Compute Closer to Users 🏒 Colocation Server: Placing Your Own Hardware in a Data Center
🌐 Language
πŸ‡ΊπŸ‡Ώ O'zbek πŸ‡ΊπŸ‡Ώ ЎзбСк πŸ‡·πŸ‡Ί Русский πŸ‡¬πŸ‡§ English βœ“