A Web.com Partner
Sign Up / Log In
Online Support Web Hosting

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

Important: There are standard PHP settings already set in the server, which your site uses by default. If you do not need to make any modifications to one or more of these settings, you do not need to create or change a php.ini file.

Step 1. Access your Hosting Manager.
Step 2. Scroll down to the Files tab, then click the File Manager option.
file manager option to access file manager via cpanel
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.
file button on the file manager page to create new file in root directory
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.
pop up window to create a php.ini file in root directory
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.
highlighted created php.ini file and edit button to edit file
Another window will appear, click the Edit button.
pop up window with information to be directed to text editor page

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:

sample configuration settings in a php.ini file

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!

Was this helpful? Yes No 43% of people found this helpful.
{"message":""}