Where is the PHP.ini File in WordPress? Complete Guide

Ekta Lamba
Ekta Lamba
Updated on: January 3, 2026
13 Mins Read
Where is the PHP.ini File in WordPress

Are you experiencing an error on your WordPress website, after you attempted to upload a theme or/plugin, that says “The uploaded file exceeds the maximum upload size allowed on this server”? Or, is your website stuck saying “memory exhausted” even though your front end looks great?

I know how frustrating that can be! Those types of issues confuse and irritate a lot of users, but the reality is that it is probably a straightforward fix in one area that you may have never even thought about, and that is PHP.ini.

So, where is the PHP.ini file in WordPress? This tiny, but important configuration file dictates some of your website’s most serious functionality in terms of performance, including: size limits for uploading files, limits on memory usage per visitor, and limits on how long any PHP script can run before timing out.

If it is not configured properly, your website could be running much more slowly than expected, failing your uploads, or worse yet, crashing completely when you suddenly get overwhelmed with visitors.

In this guide, we will explain where the PHP.ini file is in WordPress and why it is so important, as well as how to safely edit it without breaking your website. If you are merely interested in making some PHP changes or settings below, we will walk you through those other options as well, in case you are not able to access the PHP.ini file directly.

When you’re done, you’ll know exactly how to find and edit your PHP.ini file in WordPress, troubleshoot and resolve issues, and restore your control over your website.

What is the PHP.ini File in WordPress?

What is the PHP.ini File in WordPress?

Before you begin your search for the location of the PHP.ini file in WordPress, it’s important to understand what the PHP.ini file is and why it is one of the most powerful configuration files that runs behind the scenes of your website.

In layman’s terms, PHP.ini is the default configuration file for PHP. PHP is the scripting language that runs WordPress. Whenever your site loads a page, executes a plugin, or processes a submitted form, PHP will check the PHP.ini file for rules on how it should operate.

If we put PHP.ini in terms and an analogy that makes sense, you could think of the PHP.ini file as the “user guide,” so to speak, that is telling your web server how much power WordPress is permitted to use. This means that this file regulates critical settings such as:

  • Memory limits – govern how much server memory a PHP script is allowed to draw on.
  • File upload size – sets the maximum file size your site permits for upload in WordPress.
  • Execution time – tells PHP how long it can run before timing out.
  • Error reporting – determines if PHP should display or hide errors on your site.

All of the parameters are essential in determining the performance of your website. For example, if your memory limit is set too low, you may run into a “Allowed memory size exhausted” error. Or, if your upload size is too small, you may hit an upload limit when trying to upload a theme or a large media file.

By adjusting PHP.ini, you can have more control over the limitations of your site, improve the performance, and avoid generating server faults that disrupt your work processes.

Here’s the short form of the long story:

The PHP.ini file is the nerve center of your site’s PHP interactive space. Without being properly configured, any WordPress setup could run into issues in performance that may become annoying.

So, before we get into where the PHP.ini file is in WordPress, just remember, and it will help you take smart and safe action later – it is good to understand what it does!

Why Edit the PHP.ini File in WordPress?

Why Edit the PHP.ini File in WordPress?

Having learnt what a PHP.ini file does, you may ask the next question naturally – why would you need to edit it?

That’s because WordPress runs on PHP, and the PHP.ini file will control how PHP acts on your server. If in the past you’ve received memory exhausted errors, upload limits, or timeouts while installing any plugin, it is a strong possibility, your default PHP configuration may not have been enough for your site’s requirements.

When users have sought out, Where is the PHP.ini file in WordPress, it is actually a control issue – users are seeking control of the performance of their site(s) and to put limits on the speeds that frustrate users. Editing this file gives you that ability.

Now, let’s explore at least a few important reasons that editing PHP.ini could make your experience using WordPress and your site smoother and quicker.

1. Raising Maximum Upload File Size

WordPress normally limits file uploads, particularly on shared hosting. If you try to upload a video, plugin, or premium theme and you get the “upload size exceeded” message, you can rest assured WordPress didn’t stop your upload; it was PHP.

To fix this, just modify your PHP.ini file like so:

upload_max_filesize = 64M
post_max_size = 128M

Then you can upload larger media files without interruptions.

2. Increase the PHP Memory Limit

When your site runs resource-heavy plugins like Elementor, WooCommerce, or WPML, the error may read “Allowed memory size exhausted”. A simple fix involves raising the memory_limit parameter in PHP.ini:

memory_limit = 512M

Changing the memory_limit allows PHP to use more memory and keep your site active when under load.

3. Increase Script Execution Time

Occasionally, scripts take longer to run, especially when you might be importing a large database or performing a backup. Boosting the max_execution_time prevents these processes from timing out.

max_execution_time = 300

This means (5) minutes of execution time, which is usually enough for large processes.

4. Turn on Error Reporting

Troubleshooting your website and/or debugging a plugin conflict can benefit from turning on error reporting in PHP.ini. Doing so will let you view what’s going on in the background:

display_errors = On
error_reporting = E_ALL

When you are done testing, make sure to turn display_errors Back to Off for security.

5. Optimize Site Performance and Stability

Editing PHP.ini not only remedies flaws but also optimizes your website’s performance by ensuring your server resources are compatible with the needs of your website. In essence, you are telling your hosting environment: “Give WordPress the power it needs to operate at its best.”

Pro Tip: As a good practice, always back up your website and your existing PHP.ini file before you make any changes. A single typo could cause server errors or, worse yet, render your website unusable. If that happens, you can restore from your previous backup in no time.

Where Is the PHP.ini File in WordPress and How to Edit It?

Now, let’s finally tackle the issue that brought you here — Where is the PHP.ini file in WordPress?

This depends on your hosting environment. Different types of hosting, such as shared hosting, VPS, or managed WordPress hosting, store and manage PHP configurations differently. We can tackle each situation one by one so that you can be sure to get to your PHP.ini file in a safe and effective manner.

1. Locating PHP.ini in cPanel (Shared Hosting)

If your WordPress site is hosted on a server that uses cPanel, which is frequent enough, you can find and edit your PHP.ini file through either File Manager or the MultiPHP INI Editor.

Here’s what to do:

Method 1: Find using File Manager

  1. Log in to your cPanel dashboard.Login to cPanel
  2. Then scroll down to the Files section and click on File Manager.Go to File Manager
  3. Now open the public_html folder (which is your root directory).open public_html
  4. If you can find either a file named php.ini or php5.ini.php.ini file

If you don’t see one, you can create it manually:

  • You will click on + File at the top.
  • You will name the file php.ini.
  • Then add the configuration lines needed, for example:upload_max_filesize = 64M.
  • Lastly, you save the file and refresh.

Method 2: MultiPHP INI Editor

  1. Go back to your main cPanel dashboard.Login to cPanel
  2. Search for MultiPHP INI Editor under the Software section.
  3. Select the domain name you’d like to update.
  4. Then you will see fields for upload size, memory limit, and several other options that are editable! Feel free to make any updates.
  5. Save your updates, and they will automatically apply to your WordPress install.

Tip: The MultiPHP INI Editor is easier and safer to use for beginner website owners because the option prevents syntax errors, which will break your site.

2. Retrieving PHP.ini via File Transfer Protocol (FTP)

If you don’t have cPanel or simply prefer to work with an FTP client such as FileZilla, you can quickly locate the PHP.ini file as follows.

Instructions:

  • Launch your FTP client (like FileZilla or another one).FileZilla Client
  • Use your FTP credentials to connect to your site.
  • Navigate to your root folder, which may be something like /public_html/ or /www/.Go to Root Folder
  • Search for the PHP.ini, or create a file called PHP.ini that is blank.Search for the PHP.ini

Once you have found it or created it, right-click it and select View/Edit.

Add the desired PHP settings (like below or to your discretion).

memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 128M

Save the changes and upload or move the file back to the folder you retrieved it from.

Note: If you’re operating on a shared server, the PHP.ini file is sometimes stored or located higher than your root folder (such as /home/username/php.ini) and will affect all websites that are hosted on that account.

3. Finding PHP.ini (VPS/Dedicated Server with SSH)

When WordPress is on your VPS or dedicated server, you have full access to the PHP configuration file. Here is how to find your PHP.ini file using SSH (Secure Shell):

Steps:

  1. Open your terminal and SSH into your server: ssh [email protected]
  2. Once you are connected, run the command to find the PHP.ini file: php -i | grep "Loaded Configuration File"
  3. You’ll see something like below: Loaded Configuration File => /etc/php/8.2/apache2/php.ini. That’s your active PHP.ini file.
  4. Open the file with Nano or Vim text editor: sudo nano /etc/php/8.2/apache2/php.ini
  5. Edit the file and save it (Ctrl + O, then Enter, then Ctrl + X), and restart your web server: sudo systemctl restart apache2 or for Nginx: sudo systemctl restart nginx

Pro Tip: If configuring PHP.ini, you always want to take note of the PHP version in the path (/8.2/) because this may differ when you later update PHP, and therefore, moving or removing the php.ini will change the location of the configuration file.

4. Locating PHP.ini Path Using a PHPinfo File (Works Everywhere)

Can’t find your PHP.ini file? Just a few easy steps will show you where it is! You can create a tiny PHP file that will let you view all of the server configuration details.

Steps:

  1. Go to the root WordPress directory.
  2. Create a file named phpinfo.php.
  3. Then, copy and paste this code: <?php phpinfo(); ?>
  4. Upload the file and then navigate to https://yourdomain.com/phpinfo.php.
  5. Search for the line Loaded Configuration File, and the path that is next to it will be the current path of your PHP.ini file.search for loaded configuration file

When you are done, delete this file right away for security reasons.

5. When PHP.ini Isn’t Available in WordPress

In certain cases—specifically using managed WordPress hosting (WP Engine or Kinsta)—you can’t access PHP.ini for security purposes.

If that’s the case:

  • Override PHP settings with the .htaccess, .user.ini, or wp-config.php files.Locate the wp-config.php file
  • Or simply contact your hosting support team. They can do that for you.

Final Thoughts

If you made it to this point, you were no longer asking, “Where is the PHP.ini file in WordPress?” But felt assured you can find it and edit it – or even get around it when it’s in hiding.

Let’s face it, almost all WordPress performance problems, memory exhaustion, upload errors, timeouts, etc., point back to the PHP settings. The PHP.ini file is where those limits have been defined, and knowing how to find or edit the file puts you in control of your site’s real potential.

To quickly recap everything to lock it down a bit:

  • Shared Hosting Users – Find PHP.ini in /public_html/ via cPanel or File Manager.
  • VPS / Dedicated Hosting – Via SSH, type php -i | grep "Loaded Configuration File" (or just search directly).
  • Managed Hosting – You may not have access at all – either use a .htaccess, .user.ini file, or get support assistance.
  • Still cannot find PHP.ini? Then, utilize alternative things like wp-config.php or any number of plugins to safely modify PHP limits.

So while editing the PHP.ini file is about fixing errors, it’s also about optimization. When everything is configured appropriately, WordPress is fast, stable, and better equipped to grow with your user base.

Pro Tip: You should always document your changes and back up before modifying any configuration file. A simple typo could create major problems, but having an original copy will save you every time.

To Summarize: Knowing where the PHP.ini file is in WordPress grants you the ability to make your hosting environment more efficient and reliable, an ideal skill for the serious WordPress user.

FAQs

Q1. Do all WordPress Sites have separate PHP.ini files?

No. On a shared host, there is generally one global PHP.ini file; only VPS or dedicated servers allow for separate PHP.ini files.

Q2. Why do some PHP.ini file changes revert on time?

Some hosts restore to the default after server restarts, upgrades, or in cases of corrupt files. Contact your host’s support if the changes don’t stick.

Q3. Can PHP.ini settings interfere with plugins?

Yes. Uploading, caching, and security plugins rely on PHP limits, which, if mismatched, could break the plugin.

Q4. Does changing PHP versions change PHP.ini files?

Yes, each PHP path loads its own configuration file. After upgrading PHP, always check the paths again.

Q5. Can a subdomain have its own PHP.ini file?

Yes, if the host allows per-directory PHP policies. Each subdomain can have its own custom PHP limits.

Ekta Lamba

Ekta Lamba

Ekta Lamba is a content writer at DevDiggers covering WordPress, WooCommerce, web development, and emerging tech. From fixing plugin errors to breaking down ChatGPT model updates, she writes guides that make technical topics approachable for developers and store owners alike. If it involves WordPress or the web, there is a good chance she has written about it.

WordPress Speed Optimization

Say Goodbye to Slow
Load Times.

Stay Updated

Join thousands of readers getting smarter every week.

Newsletter Form

Leave a Reply

Your email address will not be published. Required fields are marked *