Search code examples
phppearmamp

How to edit ini directive?


I'm working on Mac 10.6.6. with php 5.3 installed with MAMP. I've run into a problem trying to install Pear. A blog I found suggested a solution that requires me to to set the following ini directive:

detect_unicode = Off

Can someone tell me how to do it?

I went looking through MAMP folder but couldn't see PHP ini file. Note, I'm very inexperienced working with the command line.

Thanks if you can help.


Solution

  • Check under (assuming a default install)...

    Macintosh HD / Applications / MAMP / conf / php5 / php.ini
    

    You then open this file in a text editor and modify the text to suit. Save it and restart Apache.

    Alternatively, some options can be set from PHP itself with ini_set(). Some can not for security reasons, such as allow_url_fopen.