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.
- Create a new file on root info.php and enter below code
Then run this file in browser.
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:
- Login into your cpanel
- Go to softwares section and select php version
- Select options and change settings
- Save the configuration