Steps for configuring MAMP and Drush This sequence on macOS 10.13.1 Higher Sierra worked perfectly with MAMP PRO 4.xġ. If anyone has a better method I'd love to hear it. Ln -s "/Library/Application Support/appsolute/MAMP PRO/conf/php.ini" ~/.drush/ There does not seem to be any configuration setting that will tell drush which php.ini file to use, but eventually I discovered that a symlink from the php.ini file into ~/.drushrc does work: Unfortunately drush does not respect this and insists on using the php.ini file from the same location as the php binary. Which runs perfectly when executing PHP from the command line. bashrc file:Įxport PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATHĪnd created an alias there to execute PHP with the correct ini file from the command line:Īlias php='php -c "/Library/Application Support/appsolute/MAMP PRO/conf/php.ini"' I already had the path to the version of PHP I wanted to use in my. In this version of MAMP, you edit the php.ini file by selecting File -> Edit Template -> PHP -> PHP /conf/php.ini - which does still exist. I've just switched to MAMP Pro 3, and it's awesome, but there are a few changes that need to be dealt with for drush to use the correct php.ini file. You may need to remove this line when you go to the production stage, cuz the most popular server environment is linux and mysql.socks settings are fine and works perfectly. This will make the sock connection works. 'unix_socket' => '/var/mysql/mysql.sock', Repair the sock links and follow instructions posted formerly.Īdd A simple line code to sites/default/settings.php line 247 - line 263 where these code are drupal mysql database settings. # It will show /Applications/MAMP/tmp/mysql/mysql.sock # Open your terminal and run these command This will make php command executable in terminal. Open MAMP PRO -> Main Window -> PHP -> Enable Open MAMP PRO -> Main Window -> MYSQL -> Enable īy default, MYSQL server port (default is 3306) is not open and listened, this will open the port. To get drush works well under newest MAMP PRO 4.0+, please follow the steps. SQLSTATE No such file or directory in drupal_is_denied(). Or, if this error appears with MAMP4, consider checking the "Make this version available on the command line" option.įor most people came to this page is because of the error below: Sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock To solve, from within Terminal run the following commands: To connect via unix:///var/mysql/mysql.sock)". Causes errors like "Error: PDO::_construct(): No such file or directory (trying Inability to connect to localhost MySQL via socket.bash_profile to tell Drush to use the right version of PHP export DRUSH_PHP="/Applications/MAMP/bin/php/php5.2.17/bin/php". To solve, change the version of PHP in the MAMP preferences panel or add a line in your. Default use of php5.3.6 instead of php5.2.17 causes errors upon update, most commonly "Cannot redeclare class" errors.The current version of MAMP may require some troubleshooting to get Drush to work correctly.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |