Skip to content
Servers and Linux2 min read

What is php.ini?

Short answer

php.ini is PHP's main configuration file, read when PHP starts. It sets values such as the memory limit (memory_limit), the largest file you can upload (upload_max_filesize) and how long a script may run (max_execution_time). Changing these values fixes many WordPress and upload errors.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. The settings that matter most
  2. How to see the current values
  3. Common mistakes
  4. On ArabyHost

The format is simple: a setting name, =, then the value; a line starting with a semicolon ; is a comment. The server keeps a main file for each PHP version, and on shared hosting each account can usually override some values for itself without affecting anyone else.

The settings that matter most

Setting What it does Example
memory_limit Maximum memory one script may use 256M
upload_max_filesize Largest single uploaded file 64M
post_max_size Largest complete POST request 64M
max_execution_time Maximum run time in seconds 120
max_input_vars Number of fields in one form 3000
display_errors Show errors on the page Off on a live site

Settings that allow bigger uploads in WordPress and fix the upload_max_filesize error:

upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 120

How to see the current values

Create a temporary info.php containing <?php phpinfo();, open it in the browser, then delete it right away because it reveals server details. Over SSH, php -i | grep memory_limit prints a value and php --ini shows which files PHP loaded.

Common mistakes

  • Raising only upload_max_filesize: if post_max_size stays smaller, the error remains, because the whole request is over the limit.
  • The change doesn’t show: you may have edited a PHP version your site doesn’t use, or the value is set somewhere else, such as .htaccess or .user.ini.
  • A huge memory limit that does nothing: raising memory_limit can’t exceed the account’s real limits; fixing the memory-hungry code works better.
  • Command line differs from the web: SSH commands and cron jobs may read a different configuration file from the one your site uses.

On ArabyHost

ArabyHost hosting plans include PHP 8.1, 8.2 and 8.3. You change the version and values like memory_limit and upload_max_filesize from the PHP tools in cPanel, such as MultiPHP; cPanel opens with one click from the Araby Panel, so there’s no need to hunt for the file. Values remain bound by your account’s own resource limits (LVE). On the Developer plans you can also inspect settings over SSH with php -i. If you hit Allowed memory size exhausted, the Araby AI assistant reads the error log and explains the fix. To pick a version, see choosing a PHP version.

FAQ

I changed upload_max_filesize and nothing happened. Why?

Make sure `post_max_size` is raised to the same value or higher, and that you edited the PHP version your site actually uses. Then confirm the new value with `phpinfo()`.

Can I set memory_limit really high?

You can write it, but PHP still can't use more memory than your account actually has. If a site constantly needs a lot of memory, find the plugin or query that consumes it.

What's the difference between php.ini and .user.ini?

php.ini is the main file for a PHP version; `.user.ini` is a small file you place inside a site folder to override some values for that folder only, where the server supports it.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.