Where does MAMP keep its php.ini?

前端 未结 15 2298
一个人的身影
一个人的身影 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 13:09

    The file you have to edit is in MAMP Pro and uses the php.ini file everytime it starts up.

    • Start MAMP PRO
    • Edit File > Edit Templates > PHP 5.3.2 php.ini
    • Restart MAMP Pro

    Your changes should stick.

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

    I have checked all answers and of course I have used phpinfo() to check the exact location of php.ini. I don't see a File option in the menu bar on my mac. I changed both php.ini and php.ini.temp files in that folder. No vail.

    Until I realized that I forgot to uncomment the modified always_populate_raw_post_data line.

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

    I'm not sure if in MAMP (non-PRO) is the same, but MAMP overrides the modified php.ini everytime it starts.

    In my case, I needed to use the MAMP menu to change my php.ini file (File -> Edit Template -> PHP -> PHP 5.xx -> php.ini).

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

    On my mac, running MAMP I have a few locations that would be the likely php.ini, so I edited the memory_limit to different values in the 2 suspected files, to test which one effected the actual MAMP PHP INFO page details. By doing that I was able to determine that this was the correct php.ini: /Applications/MAMP/bin/php/php7.2.10/conf/php.ini

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

    It depends on which version of PHP your MAMP is using. You can find it out on: /Applications/MAMP/conf/apache/httpd.conf looking for the configured php5_module.

    After that, as someone said before, you have to go to the bin folder. There you'll find a conf folder with a php.ini inside.

    example: /Applications/MAMP/bin/php/php5.4.10/conf

    Leo

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

    I was struggling with this too. My changes weren't being reflected in phpInfo. It wasn't until I stopped my servers and then restarted them again that my changes actually took effect.

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