Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Where Is php.ini in WordPress? (& How to Edit This File)

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you wondering where the php.ini file is located on your website?

php.ini is a critical file in your WordPress installation. You’ll often need to edit it for better functionality and performance of your website. However, many website owners don’t know where it is located.

In this article, we will show you where is php.ini in WordPress and how to edit this file.

Where is php.ini in WordPress and how to edit it

To help you navigate the post, you can click the links below to jump to any section you’re interested in:

What Is php.ini file in WordPress?

The php.ini file is a default configuration file for PHP on your WordPress site. PHP is a scripting and programming language on which WordPress is written.

It’s used on the server side of things, which means it runs on your web hosting server. Through PHP, WordPress is able to display your blog posts, products, media content, and more.

The php.ini file configures how PHP works and can have a huge impact on your website’s functionality. Whenever PHP runs on your site, it will look for this file.

That said, let’s see why and when you’ll need to edit the file on your website.

Why Do You Need to Edit php.ini File in WordPress?

The php.ini file is very important for your site’s performance and functionality. This means you can edit it to ensure your website works smoothly or resolve any errors.

For instance, editing the php.ini file allows you to increase the maximum file upload size and resource limits.

If you have a photography website or a site that requires a lot of videos and images, then you might encounter an error ‘uploaded file exceeds the upload_max_filesize’ message.

Increasing the upload size in the php.ini file will help resolve this error and allow you to easily upload larger media files. Plus, you can also increase the available memory to accommodate long blog posts with lots of images.

Check current file upload size limit

Similarly, the php.ini file lets you edit the file timeout settings. If a file takes longer to process, then your site can timeout and stop processing the request. To prevent this from happening, you can increase the number of seconds before timeout through the php.ini file.

Lastly, you’ll also be able to enable or disable file extensions in PHP by editing the file. This is really useful if you see a ‘Your PHP installation appears to be missing the MySQL extension’ error on your site. It helps fix this error and resolve issues when establishing a database connection.

Now, let’s look at where the php.ini file is located in WordPress.

Finding the php.ini File Location in WordPress

There are several ways you can locate and view the php.ini file.

You can use your hosting service’s cPanel, a plugin, or an FTP client to access your website files and folders.

1. Use cPanel to Locate the php.ini File

You can use the cPanel provided by your WordPress hosting provider and access the File Manager to locate the file. This method is pretty straightforward, and you don’t need to edit any code.

For this tutorial, we will use Bluehost to access the cPanel. If you’re using another hosting service, then the steps may vary.

First, you’ll need to log in to your Bluehost account. From here, simply click the ‘Settings’ button below your website.

Bluehost site settings

Next, you can switch to the ‘Advanced’ tab from the menu at the top.

Then scroll down to the cPanel section and click the ‘Manage’ button.

Bluehost cPanel under Advanced site settings

On the next screen, you’ll see the cPanel of your website.

Simply scroll down to the Files section and click the File Manager option.

Open file manager in cpanel

After that, you’ll see all the folders and files of your WordPress website.

From the left panel, you can navigate to the ‘public_html’ folder. Next, you should see files in the folder on your right. You can scroll down and locate the ‘php.ini’ file.

Locate php.ini file

To download the file for editing, you can simply right-click the php.ini file and save it on your computer.

2. Locate the php.ini File using a File Manager Plugin

Another way of finding out where the php.ini file is in WordPress is by using a plugin like WP File Manager.

It is a free WordPress plugin that lets you edit, download, delete, and organize your files and folders directly from the WordPress dashboard. You don’t have to use an FTP client or cPanel to access your site’s files.

First, you’ll need to install and activate the WP File Manager plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you can head to WP File Manager from your WordPress admin panel.

Next, you’ll need to select the ‘public_html’ folder from the panel on the left. After that, you can scroll down and navigate to the ‘php.ini’ file.

View php.ini file in file manager plugin

Once you’ve located the file, simply right-click to download it onto your computer.

3. Finding php.ini Path in WordPress using the phpinfo.php File

You can also find the php.ini file by creating a phpinfo.php file and placing it in the root directory of your WordPress installation.

This is a slightly advanced method and is recommended for people who know how to use an FTP client and access the root directory of a website.

First, you’ll need to create a new text editor file. You can use Notepad, Bracket, Sublime Text, or any similar software to create one. In the file, ensure that you enter the following code:

<?PHP phpinfo(); ?>

Next, you’ll need to save the file and name it phpinfo.php. You can use any other name, but make sure that there is ‘.php’ at the end.

After that, you will need to use an FTP client to access the root directory of your website and upload the file. Simply drag the phpinfo.php file from the left panel and drop it into your site’s root directory.

Upload php info file

If you need help, then please see our guide on how to use FTP to upload files to WordPress.

Next, you will need to enter the following web address in your browser:

www.example.com/phpinfo.php

Just make sure that you replace the ‘example.com’ with your domain name.

From here, you’ll see details about PHP installation on your site and the path for locating the php.ini file.

View php installation details

To find the path of the file, you can look for the ‘Configuration File Path’ or ‘Loaded Configuration File’ fields.

You’ll see the path for the php.ini file in either one of the fields.

View path of php ini file

Once you know the path, you can access your site’s files using an FTP client.

From there, simply go to the path you just discovered and download the php.ini file.

Access path of php ini file and download it

Editing the php.ini File in WordPress

Now that you know the location of the php.ini file, the next step is to download and edit it.

Go ahead and open the file in Notepad or any other text editor.

Edit php ini file

Next, you can edit the file to improve your site’s performance. Here are a few common configurations you can make in the php.ini file:

  • max_execution_time – This is the time needed to run commands and execute scripts. You can increase the default time of 60 to a higher number if you’re uploading large files to the server.
  • memory_limit – It relates to the memory needed to upload files and execute commands. Editing the memory limit will help you accommodate long content and lots of images. By default, it is set to 256M, but you can increase the memory limit.
  • upload_max_filesize – Editing this option allows you to upload large media files and increase the limit.
  • post_max_size – If your blog posts contain a lot of images and videos, then the size of the post will increase. To avoid any errors, you can increase the post_max_size to accommodate more extensive articles.

Once you’ve made these changes to the php.ini file, you can simply upload it back to your server in the same location using the cPanel, an FTP client, or the file manager plugin.

We hope this article helped you learn where is php.ini in WordPress and how to edit it. You may also want to see our guide on the most common WordPress errors and the best WordPress plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

7 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Moinuddin Waheed says

    I have faced this problem when I was using bluehost shared hosting plan and I was clueless about solving it. then I found one article which had the solution through .htaccess file.
    changing the file size there helped me overcome the problem.
    Thanks for the guide. It means there are several approaches to the same set of problems.

    • WPBeginner Support says

      There can be and you cam always reach out to your host for assistance if you don’t find the files :)

      Admin

  3. Ralph says

    I didn’t know i should take care of that file. I always thought my hosting upgrade my php to the newest version and thats it. Good to know i can upgrade post max size. My wife has furniture blog and there are lots of step by step pictures. This may help. Thank you for this guide.

    • WPBeginner Support says

      You’re welcome, your host can override some of these changes so if you run into trouble don’t forget to check with your hosting provider :)

      Admin

  4. Jiří Vaněk says

    On many shared web hosting servers without a control panel, it is also possible to edit PHP through the .htaccess or .user.ini file. It always depends on the server configuration and the provider. However, many adjustments can be made using this method as well.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.