Where is PHP.INI file

I want to change few setting in php.ini which phpinfo.php shows it is in /etc but when look it is not there. I did a search using locate php.ini and cannot find it.

Any idea where Mac keep it?

Thanks in advance.

MacBookpro 17", Mac OS X (10.6.3)

Posted on Jun 1, 2010 2:18 AM

Reply
18 replies

Jun 26, 2010 10:20 PM in response to etresoft

I had a similar issue. I found a php.ini in several directories for example:
/usr/local/php5/lib/php.ini

In the end the only way I could get the phpinfo to show the correct value was to either put the php.ini file in /etc/ or to make a symbolic link (ln -s /usr/local/php5/lib/php.ini php.ini) within the /etc/ directory. No location that the php.ini file was created would work, and the .default file is not read either. Lesson learned.

Restart web sharing in the control panel afterwards.
Works on 10.4 and 10.5 that I tried.

Jun 27, 2010 9:18 AM in response to etresoft

etresoft wrote:
dps098 wrote:
I had a similar issue.


No, you didn't.


According to this site:
http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-1 05/

" Leopard has an empty configuration file by default, but provides a file which you can use as a template."

It goes on to say that you have to create a php.ini based on php.ini.default, like I needed to do.

I'm pretty sure I have the default php5 that ships with 10.5.

Jun 27, 2010 10:30 AM in response to dps098

dps098 wrote:
According to this site:
http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-1 05/

" Leopard has an empty configuration file by default, but provides a file which you can use as a template."


Correct.

It goes on to say that you have to create a php.ini based on php.ini.default.


No it doesn't. It says you would need to edit php.ini if you want to use PEAR.

I'm pretty sure I have the default php5 that ships with 10.5.


I'm sure you do. But that php is at /usr/bin/php. You appear to have another copy in /usr/local that has gotten you all jacked up.

Jun 29, 2010 6:35 AM in response to alkhater

alkhater wrote:
Then how do hook PHP to Apache. That would be very useful.


Indeed. I've never done it myself so I can only offer general advice. The problem is that the integration of PHP with Apache in a high-speed, efficient way is dependent on Apache PHP modules. Those modules are dependent on specific versions and builds of Apache and PHP. So, if you want to change either, you need to build both. The correct way to do this is download the appropriate packages from Apple's Open Source site, modify the build parameters and rebuild them. Of course, most people take Larry Wall's first programmer virtue to heart and just download the latest packages from their respective developers. That should work too. Really virtuous programmers will just download XAMPP. Those programmers that seek to go beyond virtue, and even benevolence, and directly into Tao will realize that the system build of PHP is fine and just use that.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Where is PHP.INI file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.