Knowledge Base

Where Is My php.ini File

The php.ini file is one of the essential configuration files in PHP. It serves as the file settings which allows you to control how your PHP works on different scenarios. Scenarios like File Uploads, Display Errors, Log Errors, and more.

So where is your php.ini file located? And what will you do if you don’t see one in your PHP directory? In this guide, you’ll learn the location and how to create a php.ini file so you can start to configure settings for your PHP program.

Where Is My php.Ini File

By default, you can locate your php.ini file at your public_html directory. But for some cases, you don’t see a php.ini file, you can create it manually. Continue reading this article to learn how to create it via your cPanel.

How to Create a php.Ini File

Step 1. Log in to your cPanel.

Step 2. Scroll down to the Files tab, then click the File Manager option.

Step 3. Select the root directory for your site, the default for the primary is public_html.

Step 4. Click the + File button at the top menu of the page.

Step 5. A pop-up window will appear. In the New File Name field, enter php.ini as the file name. And enter /public_html to the New file will be created in the field. Then click the Create New File button.

Step 6. Right-click on the file you created and select the Edit option.
Or you can select the php.ini file and click the Edit button at the top menu bar.

Another window will appear, click the Edit button.

It will direct you to the Text Editor page. From this point, you can input the configuration settings you want to your php.ini file. Click the Save Changes button, and click the Close button to close the Text Editor page.

Here is a sample of a php.ini file configuration:

You’ve successfully created your php.ini file in your directory. Please let us know if you need any further assistance, or if you have any questions. We’d love to help!

Did you find this article helpful?

* Your feedback is too short