Where does MAMP keep its php.ini?

前端 未结 15 2296
一个人的身影
一个人的身影 2020-11-27 12:23

I have recently got a mac an am not used to developing on a mac at all.

I have MAMP Pro 1.9.6.1. I did a locate on php.ini and got this:



        
相关标签:
15条回答
  • 2020-11-27 12:53

    Just run the following command from your terminal, it will show you your Loaded Configuration File easiest way I have ever found.

    php --ini
    
    0 讨论(0)
  • 2020-11-27 12:59

    After going through all the solutions here, the easiest way to find the loaded php.ini file is to go into phpinfo on the loaded MAMP webpage, which will show you the loaded php.ini file.

    This will also confirm if the parameters you change, like max_file_size, have updated correctly.

    0 讨论(0)
  • 2020-11-27 13:00

    To be clearer (as i read this thread but didn't SEE the solution, also if it was here!), I have the same problem and found the cause: I were modifying the wrong php.ini!

    Yes, there are 2 php.ini files in MAMP:

    1. Applications/MAMP/conf/php5.5.10/php.ini
    2. Applications/MAMP/bin/php/php5.5.10/conf/php.ini

    The right php.ini file is the second: Applications/MAMP/bin/php/php5.5.10/conf/php.ini

    To prove this, create a .php file (call it as you like, for example "info.php") and put into it a simple phpinfo()

    <?php
    echo phpinfo();
    

    Open it in your browser and search for "Loaded Configuration File": mine is "/Applications/MAMP/bin/php/php5.5.10/conf/php.ini"

    The error was here; i edited Applications/MAMP/conf/php5.5.10/php.ini but this is the wrong file to modify! Infact, the right php.ini file is the one in the bin directory.

    Take care of this so small difference that caused me literally 1 and a half hours of headaches!

    0 讨论(0)
  • 2020-11-27 13:00

    I don't know if you ever found an answer to this but I DIDN'T need MAMP PRO to do this. Simply goto the correct path by following what others have said. It's something like...

    MAMP-> bin-> php-> php(your php version)-> conf-> php.ini

    The key here is where you're editing the file. I was making the mistake of editing the commented part of the ini file. You actually have to scroll down to LINE #472 where it says "display_errors = Off and change it to On. Hope this helps any

    0 讨论(0)
  • 2020-11-27 13:07

    I only have the non-pro version of MAMP but just because it loads it doesn't mean the PHP file is being found/without errors.

    I renamed my php.ini files and MAMP still started but Apache returned several errors.

    What are you trying to change in your php.ini file?

    0 讨论(0)
  • 2020-11-27 13:08

    Change /Applications/MAMP/conf/php5.2/php.ini if you are using 5.2 version of php. If you are using the 5.3 php version, edit the /Applications/MAMP/conf/php5.3/php.ini.

    If you are using OSX Lion or OSX Mountain Lion, I recommend you using the default installation of apache and php.

    Greets!

    0 讨论(0)
提交回复
热议问题