![]() ![]() The final generated php.ini file is located at /Library/Application Support/appsolute/MAMP PRO/conf/php.ini. Here's something interesting about MAMP Pro: it generates, each time it starts, the final php.ini file it will be using during the execution as its content depends on the settings configured on the software’s UI.įor example, if you enable/disable Xdebug on MAMP by ticking/unticking the checkbox on the app, MAMP will regenerate the php.ini file with your configuration (this is basically how MAMP applies any setting change that you perform from the UI). Configuring the Command-line to use MAMP's php.ini You can check if everything was applied as expected by executing php -ini and seeing the paths are pointing to MAMP. Remember that everytime you change your Profile you need to "reload" it by doing source ~/.bash_profile (or whatever file you are using). Mines it's ~/.zshrc because I use Oh My Zsh. If you are using the default Terminal coming with macOS chances are the Profile will either be ~/.bash_profile or ~/.bashrc. Your Command-line's Profile file depends on your shell. #export PATH=/Applications/MAMP/bin/php/php7.4.9/bin:$PATHĪs you can see I'm adding a different line per PHP version I want to potentially have available on the Command-line (PHP 7.1.33, PHP 7.2.33, etcetera) but having them all but one (PHP 7.3.21) commented with the # at the beginning.Įvery time you switch the PHP version in MAMP you should come back to the Profile and leave uncomment the same version so the Terminal and MAMP match. #export PATH=/Applications/MAMP/bin/php/php7.2.33/bin:$PATHĮxport PATH=/Applications/MAMP/bin/php/php7.3.21/bin:$PATH You need to edit your Terminal's Profile in order to add the following to the end: #export PATH=/Applications/MAMP/bin/php/php7.1.33/bin:$PATH Configuring the Command-line to use MAMP's PHP This next one is how I personally do it because it's easy to implement and it also covers something most of other guides won't which is configure the Terminal to also use the same php.ini MAMP uses. Out there you can find enough guides that helps you archive this because, frankly, there are plenty of methods to get this done. The idea behind changing the Command-line to start using the PHP coming with MAMP and its configuration is to be able to switch rapidly between PHP versions and to have the configuration for PHP in only one place. Eventually our production servers will use containers, so it just makes sense for me.By default, after installation, MAMP will make its PHP binaries "available on the browser" while the Terminal will keep on using the system's PHP with its own configuration. It feels faster when rendering in the browser and I am more confident that my projects will run as expected on the production server. So, I figured this would be a perfect time to move to Docker containers.ĭocker brings a whole new level of challenges but once I got familiar with it and deployed a few containers, it's been great. ![]() ![]() I had to reconfigure my IDE, Postman, Git, and some others. But it required me to change where all my projects live. It's not in the Applications/MAMP/ directory. The latest MAMP upgrade (v6) has changed the main web host directory. I ended up changing all three, adding error_reporting(E_ALL) to some pages, restarting the server (even rebooted the machine) and still cant get it to display any error messages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |