Although this question is very small, but it is still a recurring problem, especially in the beginner PHP students are more so. And this question, I was often asked, so here to sum up.
First php.ini files are not hidden files, there are many ways to find php.ini files, here are two of the fastest way.
1. Use the following script:
[PHP] view plain copy Phpinfo (); ?>
When you run this script in a browser, the function phpinfo () Gets the information shown in the following figure, from which you can get more specific information.
The php.ini location information is visible in the loaded Configuration file column of the diagram. For example: My position in Ubuntu12.04lts is:/etc/php5/apache2/php.ini
2. You can use the Bash command script under Linux:
[plain] view plain copy sudo find/-name ' php.ini ' will look for the location of php.ini in your entire system disk, if the system is very large this may be slow, all if you are sure PHP.I NI is/etc, you can change the '/' in the Bash script to '/etc '.
3. Position of php.ini in each operating system
OS |
PATH |
Linux |
/etc/php.ini /usr/bin/php5/bin/php.ini /etc/php/php.ini /etc/php5/apache2/php.ini |
MAC OS X |
/private/etc/php.ini |
Windows (with XAMPP installed) |
C:/xampp/php/php.ini |
I hope this article will be helpful to you.
Reference: http://www.sudo-juice.com/where-is-php-ini/