Curl library

sudo apt-get install php5-curl

Testing PHP config

The document root of the default web site is /var/www. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

Taken from https://drupal.org/node/369988

The Getting Started With Drupal video series from Learn By The Drop provides a step-by-step guide to installing, configuring and creating content with the Drupal platform. Episodes can be viewed on the web in Flash format or downloaded in a QuickTime format that is compatible with your iPod Touch or iPhone.

The first time I wanted to do this on my computer I coudn’t find a proper tutorial, all of them had parts missing, parts giving errors…etc. So I’ve decided to join few of them and add some parts myself to gather

‘The ultimate OS X Drupal Dev environment tutorial’

OSX Mountain Lion

Install Apache

The first difference in the new OS X 10.8 is the dropping of the GUI option in System Preferences > Sharing to turn on Web Sharing, it may be gone but the webserver Apache is definitely under the hood of the OS and ready to go.

Apache is pre-installed in the OS and needs to be enabled via the command line – this needs to be done in Terminal which is found at /Applications/Utilities/Terminal

to start it

sudo apachectl start

to stop it

sudo apachectl stop

to restart it

sudo apachectl restart

To find the Apache version

httpd -v

The version installed in Mountain Lion is Apache/2.2.22

After starting Apache – test to see if the webserver is working in the browser – http://localhost – you should see the “It Works!” text.

Install mysql

Once downloaded install the 3 components. You may need to adjust the Security and Privacy System Pref to allow installs of 3rd party apps because of the new security feature of Mountain Lion known as the ‘Gatekeeper’, which keeps unscrupulous installer packages at bay.

To get around this without changing the global preferences (better!) right click or command click the .pkg installer to bring up the contextual menu and select open, then you get the warning – then click Open.

Install all 3…

mysql5.5.xxx.pkg MySQLstartupitem.pkg MySQLPrefPane The first is the MySQL software, the 2nd item allows MySQL to start when the Mac is booted and the third is a System Preference that allows start/stop operation and a preference to enable it to start on boot.

You can start the MySQL server from the System Preferences or via the command line

To find the MySQL version from the terminal, type at the prompt:

/usr/local/mysql/bin/mysql -v

This also puts you in to an interactive dialogue with mySQL, type \q to exit.

After installation, in order to use mysql commands without typing the full path to the commands you need to add the mysql directory to your shell path, (optional step) this is done in your “.bash_profile” file in your home directory, if you don’t have that file just create it.

cd ;

vim .bash_profile

Add the line:

export PATH="/usr/local/mysql/bin:$PATH"

The first command brings you to your home directory and opens the .bash_profile file or creates a new one if it doesn’t exist, then add in the line above which adds the mysql binary path to commands that you can run.

source ~/.bash_profile
mysql -v

You will get the version number again, just type “\q” to exit.

Set the MySQL root password Note that this is not the same as the root or admin password of OSX – this is a unique password to the mysql root user, use one and remember/jot down somewhere what it is.

/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'

Use the single ‘quotes’ surrounding the password

Install phpmyadmin

not for now.

Download database

Download the latest version of the database from your site

Setup git

Download git – The download is titled “Snow Leopard,” but the package works fine with both Lion and Mountain Lion.

Open Mac’s “System Preferences” and select “Security & Privacy”

Under “Allow applications downloaded from,” make sure “Anywhere” is selected