wiki:website/devEnvironment/workstation/macos

Version 2 (modified by benj, 4 years ago) (diff)

--

first in order to install drush I had to to get php and pear working properly I needed to create a file called .profile in my home directory with the following in it:

export PATH=/Applications/MAMP/bin/php/php5.3.20/bin:/Applications/MAMP/Library/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

git installed straightforwardly

then I installed drush (I found out I first had to upgrade pear), by navigating to the folder I had created in my Sites directory

pear channel-discover pear.drush.org
pear install drush/drush

I had to edit the ect/hosts file thus (it's important it's in this order as OSX will ignore the hosts file if the second uncommented line here is not after the first local host one!!! took ages to work this out):

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
127.0.0.1    transitiondev
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

then I needed to uncomment the following line in /Applications/MAMP/conf/apache/httpd.conf (525):

Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

then edit in /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf replacing the demo stuff and set it to the following:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Users/ben/Sites"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/ben/Sites/tndev"
ServerName tndev
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/ben/Sites/transitiondev"
ServerName transitiondev
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/ben/Sites/transitionbodge"
ServerName transitionbodge
</VirtualHost>

in the mamp gui my ports are set to the mysql and apache defaults (there is a button in preferences->ports you need to press to set this as they are not the mamp defaults) Apache Port 80 MySQLPort 3306

I then had to install wget instructions here: http://osxdaily.com/2012/05/22/install-wget-mac-os-x

I then could download the sites files using drush

My computer then refused to run the drush command to disable the modules that should be disabled, I fixed that by uninstalling and reinstalling drush:

sudo pear uninstall drush/drush
pear upgrade --force Console_Getopt
pear upgrade --force pear
pear upgrade-all
pear channel-discover pear.drush.org
pear install drush/drush

I then downloaded the database... when in backup and migrate I chose bzip2 format to download (to prevent macos automatically unzipping it) and was then able to import the database through phpmyadmin as it was small enough. (i did this cos the drush command for piping in the database wasn't working at that point, but it may work now as drush wasn't working at that point properly)

I had to increase the memory resource for php (I'm running the older 5.2.17 cos I'm told 5.4.10 isn't good for drupal 6) in /Applications/MAMP/bin/php/php5.2.17/conf/php.ini I set this to memory_limit = 256M

I set mamps mysql preferences by running this command in terminal sudo cp /Applications/MAMP/Library/support-files/my-medium.cnf /Applications/MAMP/conf/my.cnf

then I edited /Applications/MAMP/conf/my.cnf and increased the max_allowed_packet from 1M to 16M (this might be excessive)

cleared the caches drush cc all

and I'm in.