Where is the location of the php.ini files under each operating system

Source: Internet
Author: User
Tags phpinfo
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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.