Spread the love

Sometime we installed multiple version of php on our system so it will get difficult to find the correct php.ini file.

Let’s start with easiest way.

Steps to find the php ini file on dedicated, localhost and ssh based enabled server.

  1. Create a new file on root info.php and enter below code

Then run this file in browser.

Loaded php.ini file

As we can see in marked red loaded configuration is /Applications/XAMPP/xamppfiles/etc/php.ini

so we can easily find and change the configuration here using command in ubuntu/mac

sudo vi /Applications/XAMPP/xamppfiles/etc/php.ini

in windows we can directly go to the location and edit this file.

What if you are on shared hosting?

In shared hosting we can’t edit php.ini file directly.

So how to edit php.ini configuration on shared server?

To edit and update the php configuration on shared server, Cpanel provide a simple way to edit some configurations to edit it we need to follow the below steps:

  1. Login into your cpanel
  2. Go to softwares section and select php version
  3. Select options and change settings
  4. Save the configuration
Cpanel to change php.ini configuration
Php.ini file cpanel

2 thoughts on “How to find php.ini file location ?

Leave a Reply