Home

Lullabot

Lullabot Ideas

We know stuff. We empower you to know stuff too.

Drupal Module Development Deep Dive Week

London, UK
September 20-24, 2010

Install a Local Web Server on Mac OSX

Video by Addison BerryJuly 15, 2007 - 11:57am

Need a place to test your website before you show it to the whole world? Don't always have an internet connection but you'd love to spend that time tinkering with your site? A great way to work and test things out is to install a web server right on your own computer. This way you work offline and if you mess things up you can just start over again without taking your site down or futzing with FTP and/or SSH.

This video will show you how to easily install a web server on your Mac using MAMP. MAMP is a bundle of all the tools you will need in one package: Apache, MySQL and PHP. We'll walk you through downloading and installing it and then we'll go through some basic set up to get you up and running.

MAMP is a Mac-only application but the plan is to create videos with similar packages for other operating systems.

Play the video (.mp4)

Transcript: 

This video is going to show you how to install a local web server on your Mac using the MAMP application. MAMP stands for Mac, Apache, MySQL and PHP.

Download (0:19)

The first thing I'm going to do is search the web for MAMP and the first thing that comes up is mamp.info's website. So we'll click there. When you get to the MAMP site the first thing you'll see is that they have MAMP Pro which actually costs money. But if you move over to the right you'll see the regular MAMP and that's a free download. Now on the download page, you get down here to the actual package you'll notice that it has MAMP and MAMP Pro. They aren't separate, they're both in the same package and you select which one you want when you go to install it. So, I'm just going to go ahead and click on this download link. That will open the download dialog box that asks you to save the file and I'm actually going to click Cancel because I already have it downloaded but you would click Save File and that will save the .dmg to your desktop or wherever your downloads get stored.

Installing (1:16)

So I go to my desktop and I open up the dmg and that will mount the image. And when I go into the image I'm going to have the MAMP and MAMP Pro folders so I can select which one I want and there is an Applications shortcut. I just need to drag the MAMP folder to either that shortcut or to my main Applications folder. And that's all I have to do to install it.

Configuring (1:37)

So now I'm just going to unmount that image and go into my Applications and find my newly installed MAMP. And within the MAMP folder is the MAMP application so I'll double-click that and start that up. Now when you start up MAMP the first thing it's going to do is take you to its welcome page. And you'll notice where that is in your browser, is it's at localhost:8888/MAMP and that's the default location for MAMP's startup. And it has all of the MySQL information so that you know how to access your mysql on this server. And there's also this application window and this is showing you which servers are running. Both of ours are running right now. And we're going to look at the preferences and kinda go through those real quickly.

Start/Stop (2:24)
At the top you have "Start Servers" and "Stop Servers." If you want, whenever you start the application you can start your servers up automatically and the same with quitting. If you want MAMP to keep running even if you don't have the application in your dock then you can uncheck "Stop Servers when quitting MAMP" and then that way you can close MAMP but your actual servers are going to still be going and you can still use it. I don't want to check for MAMP Pro. "Open start page at startup" that's totally up to you. That means every time you open MAMP this page is going to open up in your browser so that's totally up to you. That's a personal choice. I'll just uncheck that.

Ports (3:07)
In the ports section MAMP lets you choose which port numbers you would like to use for your servers. By default Apache would be 80 and MySQL would be 3306 and the reason that MAMP does this with these higher numbers is so that it can run in parallel with another locally-installed web server and not conflict with it. So your browser is looking for localhost, it's looking for those standard port numbers and by using these I can point my browser specifically and say "Now I want you to look at the MAMP web server" not the other one that I have installed. So if this is the only installation you're going to have for a web server you can set this to the default Apache and MySQL ports and what that means is that when you go to type the URL into your address bar all you'll have to type is "localhost" rather than "localhost:port number". So it just simplifies things a little bit if it's your only installation. For me, I actually have another installation and so I want to keep those separate port numbers and that's how I would have to get to it.

PHP (4:10)
On the PHP, you can select which version of PHP you'd like to use, you have the Optimizer, you have some caching options. So you can pimp out your PHP.

Apache - Setting the Document Root (4:20)
Under Apache, this is really important. This is the Document Root. This is the root of your web server where all of your files are going to go. Now by default it is in /Applications/MAMP/htdocs, which is a fine location. But it's also a little bit buried so we're going to look at how you change that up and put your web root anywhere you want. So let's go look at our directories and see what's going on here. So, this is my MAMP folder. MAMP folder, within that I have htdocs and that is where all the files on my web server are going to go which would be sort of the equivalent of public_html or www maybe on some other server you might be familiar with. Now what I want to do though is I don't want to have to drill all the way down. I'd like to have one that is a little higher up in my directory structure. So I'm just going to create a new folder and you can call it whatever you want. You can all it "websites", you can call it "mysites", you can call it "foo". Let's go with foo, sounds good. So I have my foo directory which can be anywhere and now all I need to do is have MAMP point to that as the document root instead of having it point to htdocs within the MAMP folder. So I'm going to go back to my preferences panel and for Document Root I no longer want that. I'll select, find my foo folder and now it's got the root directory there. It's going to restart the server because I've made a configuration change and it needs to restart itself so that's what it's doing there. See, it's turned it off and it'll go green when it goes back on. And there, now anything that I put in foo is actually going to work.

Testing the localhost (6:04)

I'm actually going to show you by putting a file in there real quick so that you can see how this is all working in action. I've got an index.html file here so I'm just going to go ahead and copy that and I'll paste that into my new document root. There we go and then I'm going to go to my browser. And in my browser I'll go to localhost:8888 because I have that port and this is my index and it's working. That's was my index file was. So you can see that that's now my document root and everything can go in there. My web server is up and running.

MAMP Start Page (6:50)

The next thing I want to show you real quickly is some of the things that come with MAMP. We'll go back to our MAMP start page. You'll see there is a navigation bar. So here is my phpinfo. So instead of having to create my own file for that, here's my information. And it also has phpMyAdmin which is just like any other phpMyAdmin that you may have used. And it also has an SQLiteManager if you'd like to use that for a database as well. And you can access all of that from your MAMP start page.

Install the Dashboard Widget (7:20)

OK, so the last thing I want to show you is how to install the MAMP widget which would go in your dashboard. So I'm going to go back into my MAMP folder and there's the widget and all you have to do is double-click that to install it and it says yup Install. It'll show up in your dashboard and you want to click on the Keep button and then you can put this up in there and then basically it allows you to start and stop your severs or go to your start page just from the widget. Also if you click on the information for the widget it'll show you, you can select which version of PHP you would like to use. So that's just a handy thing to use just for quick access to your server.

So that's it! Everything's installed and you are now ready to begin creating your own websites on your local machine.

Comments

Sune (not verified) on July 15, 2007 - 1:24pm

WOS

Do a video on WOS Portable (for windows) - http://www.chsoftware.net/en/useware/wos/wos.htm

It takes around 30 secs to install a complete system DRUPAL/Apache/MySQL5/PHP5.
It will be a very short video!

XAMPP can do (almost) the same.

Sean (not verified) on July 16, 2007 - 11:53am

How about how to record a screencast on a Mac?

Thanks! these are great little lessons.

ShadZee (not verified) on July 18, 2007 - 1:20am

Thanks and ...

Thanks for the video.
I'm just starting with Drupal, and got the local copy installed and working to understand different aspects of the Drupal.

I have a question for the MAMP setup:

My plan is to move the "local/development" site onto the "hosted/real" location (shared hosting) after all the configurations and modifications. I assume I can backup the local database and move it to the "hosted/real" location? Therefore...

- Does the Database name have to be the same to ease of migration?
- Should I set it up with table prefix naming ?
- Is there any specific naming convention I should follow?
- Is it possible to have a two-way replication of data between the Hosted and Local databases ?

And I guess the most important question is:
- Is there a Video/tutorial on how to transfer a complete Drupal site (in this case from local to Hosted location)?

Thanks.

July 26, 2007 - 6:59pm Addison Berry

Hi ShadZee, Well I'll see

Hi ShadZee,

Well I'll see how well I can answer your questions.

1. The database name doesn't need to be the same. You just need to bring the structure and data over.

2. Table prefixing is really only useful when you only have one database at your disposal and you want to have multiple, separate installations running. So for instance if my hosting provider only gave me one database and I wanted to install Drupal as well as another application like Gallery I would want to use prefixing so as to avoid both of them trying to use the same table name (like maybe users) and getting confused. With prefixing I could have drupal_users and gallery_users so they would be unique. If you have access to multiple databases, it makes more sense to use a separate database for each application and then there is no need for prefixing.

3. The best naming convention is simply one that makes sense. :-p You should name directories and databases in a way that is clear to both yourself and others who may follow after you.

4. There are ways to have replication between databases but honestly that is out of my realm of knowledge. Maybe someone else reading along will have some input there.

5. I don't know of any videos about transferring sites. There is a page in the handbook (which I'm not really familiar with) that has some pointers on moving test to live although that looks to be on the same server and not from localhost up. But basically the idea is to copy the files and the database up to the new site and adjust the settings.php if necessary. Obviously you should do that on a test first before really doing it live. Maybe once you do it you can make a video yourself about how you did it or at least maybe a handbook page to help others down the road!

Oliver Siodmak (not verified) on July 23, 2007 - 6:59pm

Great tip .. Thanks

Addi,

Thanks for the great tip. I just jumped through all the hoops to get Apache, MySQL and PHP installed on my Mac to support my development efforts. MAMP certainly makes this 100% easier .. plus you have access to PHPMyAdmin to boot.

Great video podcast. Keep 'em coming.

OJS

BWCA (not verified) on July 26, 2007 - 1:51pm

Parallels to the rescue

I install Fedora Linux on a Parallels virtual machine on my MacBook Pro and start it when I want. It's like having a local webserver that I can fire up any time or just suspend on a moments notice.

All of my web servers are LAMP (Linux, Apache, MySql, PHP) and so I can be consistent with my web server environment.

Anonymous (not verified) on July 26, 2007 - 8:19pm

Thank you

I've done this before, but I work with so many so many os systems I get a little twisted. Thank you so much!

Anonymous (not verified) on July 29, 2007 - 11:32pm

Thanks - is this at drupal.org? & resources used

Hey, thank you so much, I've been developing on my live site because I couldn't find a mac (powerpc) AMP.

Is it linked in drupal.org I wonder?

And, I have a powerbook - is this enough horsepower for MAMP?

Zaph

PS: Grateful for your help, but skint, I will ship you a novel if you wish as reward.
Let me know

July 30, 2007 - 9:32am Addison Berry

MAMP is in the handbook

MAMP is referred to in the drupal.org handbook in a few places, I guess the main one being HOWTO: Create a local environment using MAMP in the Setting up a development environment section. I've also added this videocast to the handbook in the Videocasts section (http://drupal.org/node/159534).

I've not used a PowerBook myself but I imagine it will be fine with MAMP. The only resource requirements that I'm aware of is that you have enough disk space to hold it.

Glad the video helped you out!

chris (not verified) on August 6, 2007 - 12:46pm

Where's and why's?

I followed your tutorial and have successfully installed mysql and apache on :8888 and :8889. Thanks.
I've installed drupal over them and it's all working, apparantly - but... how do I now get to the Mamp start page and phpmyAdmin. When I click the Mamp app>open Start, then Page Port:8889 doesn't connect through to mysql, it gives a bad handshake response.And Port:8888 takes me into drupal... How am I able to get to the database if I should wish to?

Hope you can provide a solution. Ta.

chris

August 9, 2007 - 2:52pm Addison Berry

Append MAMP or phpMyAdmin to your localhost URL

The MAMP start page is at http://localhost:8888/MAMP/ by default. You can change the address for it in the Preferences (start page URL field.)

Also by default the start page will open up whenever you start MAMP. If you have unchecked the "Open start page at startup option" then you can click the "Open start page" button after you open MAMP up and get the little control panel. Alternatively you can use the dashboard widget if you have it installed.

phpMyAdmin should be at http://localhost:8888/phpMyAdmin/. The port 8889 for MySQL is the internal address to connect to the MySQL server. phpMyAdmin is totally different and is just a nice GUI interface to MySQL.

To access the database without using phpMyAdmin you can use /Applications/MAMP/Library/bin/mysql from the command line. Note that this assumes you understand how to use MySQL from the command line. If not, it is best to stick to phpMyAdmin.

Chris (not verified) on August 11, 2007 - 7:03pm

Settings etc.

Thanks for your helpful reply. It was handy to get into phpMy admin - and stupid of me not to work out that that would be the address.
However I've been even more stupid since then - and managed to lock myself entirely out of my localhost, with the help of the User permissions in Organic Groups! localhost :8888 now returns the message 'page not found' - and 8888/admin returns Access denied. It might be something to do with a clash between Taclite and OG. Not sure. Does it imply a complete rebuild -or is there a way to re-configure things via mysql? I'm afraid it might. Running before you can walk is a great way to get far - and bruises!
One other related question: will pointing Mamp at another folder - as you do in your tutorial - have any effect on using Amfphp, since it must sit in the root?

Thanks again for your help.

Julie (not verified) on August 9, 2007 - 9:44am

How can you access the local

How can you access the local site from other computers?

mozmac (not verified) on August 21, 2007 - 5:37pm

You should be able to simply

You should be able to simply go to your computer's IP address from another computer on your local network. If your local site is behind a firewall, outside computers won't be able to access it unless you forward port 80 on your firewall to your local site's IP address.

Anonymous (not verified) on February 28, 2008 - 11:20am

True but that won't work

True but that won't work when you build your site using absolute directories.

If your site uses:

/images/logo.gif

instead of

images/logo.gif

So if you setup more virtual hosts in MAMP, absolute directories will work in your computer running MAMP for:
http://mycoolsite.dev/

but on local computers mycoolsite.dev is actually in:

http://192.168.1.101/mycoolsite/

and that will look for images in:

http://192.168.1.101/images/

instead of

http://192.168.1.101/mycoolsite/images

So basically if you're using virtual hosts with absolute folders, you can't use local computers to view the site. Also if you're using databases with virtual hosts.

maryliz (not verified) on September 22, 2008 - 9:17am

Any Solution for this?

I have googled all over the internet regarding this issue and no one seems to offer a solid solution. Has anyone discovered a solution to this issue?

I'm currently running MAMP Pro on my Macbook Pro. Most of my sites use a complex framework that reference the images, stylesheets and links via the root directory (i.e. <a href="/contact">).

I have Parallels installed for the purpose of testing my sites in IE. I can easily access my MAMP server by typing in my OS X IP address into the browser address bar in Windows. However, when I navigate a site located on the server (i.e. http://192.168.1.103/~my_username/coffeecup.com/public_html/), the styles and images don't appear. It also doesn't properly connect to the database, since files are being referenced in a way it can't understand.

Does anyone have an idea what I could do to fix this?

Anonymous (not verified) on August 13, 2007 - 6:41am

Thank you so much. This site

Thank you so much. This site is FANTASTIC.

Nathan Bowers (not verified) on September 5, 2007 - 9:02pm

MAMP Pro has the key feature: multiple local projects

If you want to run more than two PHP site locally at the same time it looks like you need MAMP Pro. MAMP Regular only supports one site at a time, but you can also run a site out of the standard OS X "sites" folder.

Another way run numerous PHP sites locally is by adding entries to your hosts and apache config files so you can get localsite.dev, anotherlocalsite.dev, and so on.

Great screencast though!

(btw, your spamfilter put me into an infinite CAPTCHA loop, grrrrr)

September 5, 2007 - 10:01pm Addison Berry

Don't need MAMP Pro

I can't see needing to get MAMP Pro for multiple instances unless you wanted to have different server configurations set up simultaneously. I don't get that crazy with my dev setup. You are right that you can use hosts files for multiple sites and once you know what needs to be done it is easy to add new sites. I used to do that on my old machine and keep telling myself I'll do it again, but it never seems like I feel like doing it. How lazy is that? ;-)

I've actually been pretty low-tech about multiple sites and simply have a folder for each site I need to run in my doc root. So it means I have http://localhost/site1, http://localhost/site2, etc. My doc root dir gives a directory listing so I can go to http://localhost and see all of my sites at once and pick which one I want, which is handy when I have a bunch of test sites spawned all over and I don't really remember the names. I typically create Firefox keywords for my high use ones.

Anonymous (not verified) on September 19, 2007 - 1:55pm

wtf?

OR... you could just use the BUILT IN PHP/APACHE/MYSQL that ships with OS X...

yeesh

Jeff Robbins on September 19, 2007 - 5:04pm

OS X

Dear yeesh,

OS X 10.4.x (a.k.a. Tiger) ships with PHP version 4 (not the current version) and without MySQL.

September 19, 2007 - 5:36pm Addison Berry

OS X doesn't have MySQL

Actually OS X doesn't come with MySQL at all and it only comes with PHP 4.4.7 so if you want to use PHP 5 you will need to install that yourself as well. MAMP has the nice side benefit of being able to switch between PHP versions as well so testing custom code on both versions is a snap. Add to that the fact that clean URLs do not work "out of the box" with the Mac Apache and MAMP is a LOT easier to use than trying to install and configure everything you need.

So far MAMP is the fastest and simplest way I've found to install everything you need to run Drupal locally, especially for folks who are not familiar with webservers. When I first got my Mac, I did indeed manually install MySQL and PHP 5 (though I never futzed with Apache enough to get clean URLs working) and I used that for a long time just fine. I originally installed MAMP because I had to get clean URLs working quickly for a project and didn't feel like dealing with Apache and MAMP took me less than 5 minutes to set up. Once I started using it for that project I never went back to my old server set up (which is still around and usable.)

MikeyLikesIt (not verified) on September 20, 2007 - 7:45pm

How do I get Clean URL's working

Thanks for the great video. I just got a Mac last week, so I'm still trying to learn the best way to set up a local development environment, and MAMP is already making that a lot easier. However, you mention clean URL's being easy to set up in MAMP. On my computer, they aren't working, so I'm hoping you can tell me what setting I need to change.

Since I'm not using MAMP pro yet, I have a single drupal installation running with a multisite configuration, and I'll make host file entries to access the different servers. It works nicely and the urls are identical to the live servers except that I point o dev.myserver.org, instead of www.

Anyway, from the Clean URL's admin screen at http://localhost/?q=admin/settings/clean-urls I run the clean url test which sends me to http://localhost/admin/settings/clean-urls and I get a 404.

I was going to look into this on the drupal handbook page http://drupal.org/node/15365 but if MAMP has a way to do this, that would be much easier and simpler.

Thanks for any help.

September 22, 2007 - 8:09am Addison Berry

Check your .htaccess

Hm, well clean URLs worked out of the box for me with no other work necessary. One thing to check is to make sure your .htaccess file in Drupal is actually there. Since it is an invisible file it will sometimes not end up in the installation depending on how you have copied/transferred your files. This is needed for clean URLs to work.

If you have the .htaccess set up fine, then I'm honestly not quite sure how to advise other than looking at the MAMP HowTo on drupal.org since I haven't encountered the issue myself. :(

MikeyLikesIt (not verified) on September 23, 2007 - 4:17pm

thanks. it was the .htaccess file

I really should have thought of that. Since I've had my Mac less than two weeks, I don't know if this is the best solution, but I resolved this problem by installing the "Show\Hide Files" utility - http://www.macupdate.com/info.php/id/15585, since I figured it would be useful for alot of the dev work I'll be doing.

Thanks for the help Addi

Cathy Theys (YesCT) (not verified) on May 6, 2009 - 4:53am

video: installing drupal after mamp install w/ cleanurls php.ini

I did some (a bit organic and unorganized) videos of me installing drupal after following addi's great mamp video. In my videos, I had trouble getting clean urls and also I had to up the php memory limit, and I show the htaccess and php.ini file for those problems. I dont have time to re-do the videos to make them more seamless, but I thought I would post them to see if anyone else could benefit from watching my mistakes (and how I fixed them).

http://cathytheys.blip.tv/file/2078276

Robert Douglass on September 20, 2007 - 4:28am

I've compiled my own Apache, PHP and installed MySQL

I did this while trying to get step-through debugging to work. Then Komodo made it easy for me to do step-through with MAMP, and I'm back to using MAMP. You can do it any way you want, but Addi is right... MAMP is the fastest way to get up and running on a Mac.

simon (not verified) on September 20, 2007 - 9:48am

Testing ServerFolder

I have a site created in php which i want to view on my local computer. I have installed MAMP and all works well but I do not know what my testing server folder should be in Dreamweaver so I can view the php files. Can anyone help

September 22, 2007 - 8:36am Addison Berry

I don't use Dreamweaver

Unfortunately I don't use Dreamweaver so I'm not going to be much help. Maybe someone that uses Dreamweaver could shed more light.

MikeyLikesIt (not verified) on September 23, 2007 - 6:38pm

Preferences » Apache » Document Root

Your testing server folder would be set to the same location as your document root for MAMP, which you can see by opening MAMP and going to Preferences » Apache » Document Root

Hope that's what you were looking for.

ejhildreth (not verified) on September 20, 2007 - 12:04pm

Script Memory Limit

When I was setting up DRUPAL-6-0-BETA-1 on MAMP, the install script kept failing. When I went and looked at the php.ini file, the memory limit on scripts was set at 8MB. By bumping this limit up to 128MB, it took care of the issue.

File locations of php.ini files:

  • /Applications/MAMP/conf/php4/php.ini
  • /Applications/MAMP/conf/php5/php.ini
David (not verified) on October 21, 2007 - 1:26pm

Thank you

Even though you might think that it wasn't much, for a newbie like myself your comment ended a two day (48hours) of frustrations in looking for the damn location of the php.ini file. I nearly gave up.

Thank you so much.

It just shows that simple comments like that can make a newbie's life simpler.

David.

Sam (not verified) on September 30, 2007 - 12:02am

Getting PHP code not start page

Hi, that was a great tutorial, but it didn't help me with my problem. Can you tell me why I am getting the following message when my MAMP start page is called?

<?php
$language
= (isset($_REQUEST["language"]) && $_REQUEST["language"]) ? $_REQUEST["language"] : "English";

$fp = fopen('../startMysql.sh','rb');
$file = fread($fp,filesize('../startMysql.sh'));
fclose($fp);

$port = '9999';

if(
ereg('port=([0-9]+)',$file,$regs)){
   
$port = $regs[1];
}

$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');

if(
$link){
    include(
$language.'/mamp.inc.php');
}else{
    exit(
'Error: Could not connect to MySQL server!');
}

mysql_close($link);
?>

I have two green lights and ports set to 8888 and 8889 and have installed and rebooted twice. Any help is appreciated.

matthew (not verified) on October 5, 2007 - 9:29am

very odd white-screen problem

thanks for the video, addi. It was very helpful!

I followed it step-by-step and it all seemed to be working (installed mamp, setup a database, created a local drupal site, viewed and started to configure site). all that was fine and very straightforward.
But when I'm viewing/configuring this new drupal site (at port 8888), I will frequently get a white browser screen. there is no error, or "page not found", it's simply white. sometimes a re-load will cause it to fill in, and other times it won't. For example, I will be at at the administer page turning on a module. after hitting "submit", drupal process the information, but returns a white screen. I know that it was processed correctly because in the event that a refresh helps, the confirmation message about "module installed" or "view updated" (or whatever it was that I was doing) appears as expected.
before I installed MAMP, I had another local server using a virtualhosts file and individual ports per sandbox (but none that overlap the mamp settings.) I decided to switch to mamp because of it's all-in-one mentality, and because I was having trouble getting clean URLs to work. The two servers don't seem to be conflicting, but I thought I'd mention it in case you feel it's related. The sites I built with this previous setup do not have this white-page problem.

It is near impossible to work when one in every 3 or 4 clicks results in a white page.
have you ever encountered this before?!?

thank you very much.

-matthew

Shai Gluskin (not verified) on October 24, 2007 - 12:10pm

Same problem

I've got the same problem here, but I only get the blank screen, just as Mathew described.

October 24, 2007 - 1:16pm Addison Berry

Find the error

I've not encountered this with my install of MAMP but you need to find the error behind it. Often WSOD is caused by a memory limit issue with PHP (or wonky custom code ;-).)

First thing to do is check your logs: Drupal watchdog (at Administer > Logs > Recent Log Entries) and the MAMP server logs (located in /Applications/MAMP/logs) to see if they tell you what the problem is.

When doing development it is also handy to turn on error reporting in your php.ini file. It is located in /Applications/MAMP/conf/php5 (or php4 if you are using that.) Make a backup copy of the existing php.ini before you make any edits. Open php.ini and find the "Error handling and logging" section (line 235 in my MAMP php.ini.) You want to uncomment (remove the leading semicolon) the line that says "error_reporting = E_ALL & ~E_NOTICE" and then just a few lines below that find the line for "display_errors" and set it to "= On" and make sure that is uncommented too.

You will need to save the file and restart the MAMP server for the new settings to take effect.

If you are hitting memory problems you will need to increase the memory limit in php.ini as well. The "Resource Limits" section of php.ini is right above the Error handling section. You can change the "memory_limit" to a higher number of M. Don't forget to restart the server every time you make a change to php.ini.

chris (not verified) on November 13, 2007 - 11:19am

Thank you addi!

I kept getting white screens after the first page of set up (right after adding the db data) so i could never admin the site because i was never getting to the install stage of setting up an administrator (or super user).

Upping the memory solved this while using MAMP.

chris

Jon Dear (not verified) on November 13, 2008 - 11:37am

Drupal 6.6 install MAMP Pro on Tiger 10.4.11 can't get to admin

I tried everything and I still get the same thing as Chris above, "i could never admin the site because i was never getting to the install stage of setting up an administrator (or super user".

So far:

1. I made sure permissions are set to 777
2. Created a folder called files (and made sure permissions are set to 777)
3. Created a db with myPHPadmin, followed the video and created a) a user with explicit privileges for the newly created db. Couldn't login. Says either username or password are wrong. Did it several times.
4. Tried creating a user with global privileges. Same thing
5. Tried creating a new db and new users. Same thing.

Best I can get is an HTTP error 500, and then after can get in as a user with no admin privileges.

Tried quitting MAMP Pro, and upping the php.ini memory limit from 8mb, in all places,
/Library/Application Support/living-e/MAMP Pro/conf/php.ini

/Applications/MAMP/conf/PHP4/php.ini and in
/Applications/MAMP/conf/PHP5/php.ini and in

Same thing. And the warning in Database Configuration still ssays PHP memory limit is 8mb.

Tried reinstalling the entire 6.6 Drupal tar from scratch. Same thing.

What am I doing wrong?

I have MAMP Pro running since yesterday no problem, as localhost, across my local 192.x.x.x network, and across the internet with no problems serving web pages.

Also installed other CMS, Joomla, on the MAMP Pro server, no problem.

Maybe I'm doing something wrong in the myPHPAdmin setup, as it isn't recognising the username/password, but I can't see what it could be. And couldn't find anything that I haven't tried. Help!

Jon Dear (not verified) on November 13, 2008 - 5:55pm

Drupal 6.6 and 5.12 install MAMP Pro on Tiger 10.4.11

Ok, took a walk. Started again with Drupal 5.12 from scratch. And ... Drupal installation complete!!
...it worked. Didn't up the memory from 8mb. Then I redid the 6.6, download, new database, new user, and success too.

Main thing that I think was different was that I added a prefix in the Database Configuration Advanced Options, "drupal5_" for the 5.12 installation. And later when I went on to redo the 6.6 installation, "drupal6_".

I'm using separate db's for each version, drupaltest5 database for the 5.12 installation, and drupaltest6 database for the 6.6 installation. Yet they seem to need their individual prefix to work.

I'm assuming this is what did it, as its the only thing I can think of that I've done differently.

Thanks

Emile (not verified) on October 5, 2007 - 10:21am

MAMP / MAPP?

Thanks Addison. Great video. I tried it on my macbook with 2gb ram. Works great. I also would like to learn more on how to move from localhost to say an Apache Web Server on Centos Web Server but with PostgreSQL iso mySQL.

Perhaps another good topic for MAMP would be one that shows
Mac, Apache, PostgreSQL and PHP. (Why is it that PostgreSQL seems to get necglected even though it is a better db than mySQL in my opinion?)

Perhaps someone familiar with PostgreSQL could make the "MAPP"video? Is there even a "MAPP" package out there yet?
(Mac/Apache/PostgreSQL/PHP). If so, do you feel that drupal is stable enough with PostgreSQL vs mySQL?

Thanks for a great video!

Alex (not verified) on November 13, 2007 - 8:50am

Thanks a lot...

Having just acquired a Mac G5, I was wondering how to set up a testing server (I'm used to using IIS on Windows). Your video came up about first on a Google search - ten minuted later, it's perfectly clear what to do. Many thanks for a great video - I've got the site bookmarked!

John (not verified) on November 24, 2007 - 10:45am

Connect to MAMP from within Parallels/XP Pro

Everything installed and working fine - thanks for the video. Having done this all manually in the past, I couldn't believe how simple it was.

Just one small question. I've got the MySQL GUI tools installed, running in Windows XP Pro inside a Parallels virtual machine (I just find them easier to work with than phpMyAdmin). I can connect successfully to the Apache web server (for anyone else who's trying, the root is http://[name of mac with hyphens instead of spaces and no apostrophes].local:[Apache port number set in MAMP preferences] which on my macbook is http://johns-macbook.local:8080/), but I can't seem to connect to the MySQL server.

I've tried using localhost, johns-macbook.local and my Mac's local IP address as the server addresses, without any joy. Anyone else got any ideas?

Jeff Robbins on November 24, 2007 - 2:48pm

Firewall

Do you have the Mac OSX firewall turned on? If so, try turning if off. If that's the problem, you'll need to open up the appropriate port(s) for MAMP.

John (not verified) on November 26, 2007 - 12:39pm

Think I've found the answer

I've switched the firewall off completely to test (OS10.5's firewall is a giant leap backwards IMHO, as you can't see which ports are open or closed), and still no joy. I'm not sure that would have had much effect on the Mac version of the MySQL Administrator. For this, the query doesn't have to pass through a firewall as it's sitting on the same machine - I tend to use the Windows version as the Mac version is a 'cut down' version.

This link http://bugs.mysql.com/bug.php?id=26178 relates to the MySQL Migration Toolkit and XAMPP rather than MAMP, but it might be that MySQL isn't installed in a default location. Seems strange as as reason, as you'd think that it's looking for the name of a host on a port, rather than a file in a specific location.

It's only a minor irritation - I'm sure most of the rest of world uses phpMyAdmin. I'll just have to see if I can find an alternative to the Migration Toolkit somewhere.

Anonymous (not verified) on November 27, 2007 - 7:24am

MAMP

I cannot thank you enough! For days I struggled to install PHP using Mac's Terminal -- and though the server connection was working, my PHP code was not executing reliably. Your video and Mamp got me running in about 2 minutes.
Thank you, thank you, thank you!!!

JuliaKM (not verified) on November 27, 2007 - 9:47am

Thanks...SSL?

Thanks for the great tutorial. I am trying to configure SSL to work with MAMP so that I can test parts the e-commerce module on my local computer. Configuring SSL with MAMP has proved to be a bit of a headache. Any advice?

Elgreg (not verified) on June 28, 2008 - 10:44am

SSL w/MAMP

I managed to get SSL working with MAMP by following the instructions here to set up the certificate:
http://www.macosxhints.com/article.php?story=20041129143420344

it's really important to follow these to the T when doing the Apache2.conf.

and then this article to set it up with MAMP:
http://www.jaanuskase.com/en/2006/12/switch_web_nerddom.html
(search for MAMP and/or SSL and you'll see two commands that you'll need to run in the terminal each time you restart MAMP to get SSL set up)

/Applications/MAMP/bin/apache2/bin$ ./apachectl stop
/Applications/MAMP/bin/apache2/bin$ sudo ./apachectl startssl

There was also a thread on MAMP forums here that was useful:
http://forum.webedition.de/phpBB/viewtopic.php?f=2&t=2340&hilit=ssl

I think the useful part here was showing where the MAMP apache2.conf points to for SSL stuff.

You'll have to restart Apache a few times (I found the easiest way to do this in MAMP was to just click Preferences and then hit "close") and the quickest way to test if the ssl is working is to just drop an "s" in into the http of the MAMP start page. If you still see the start page, it's working. Then you can go mess with Drupal problems if there are any. :)

Lastly, I set up my MAMP to work on the standard 80/3306 ports - don't know if that helped to do the SSL b/c I had it done already - but it might be something to try if all else fails.

David (not verified) on November 28, 2008 - 6:22pm

Elrog Wrote: (search for

Elrog Wrote:
(search for MAMP and/or SSL and you'll see two commands that you'll need to run in the terminal each time you restart MAMP to get SSL set up)

FYI, you needn't switch to the command line when restarting MAMP in order to enable SSL each time. Instead, edit the shell script MAMP calls when starting apache:

  • /Applications/MAMP/bin/startApache.sh

Instead of:

# /bin/sh
/Applications/MAMP/Library/bin/apachectl start

Edit the file to have the following:

# /bin/sh
/Applications/MAMP/Library/bin/apachectl startssl

Now, when MAMP starts apache, it will do so with SSL enabled.

Cheers,
David

CmdrGuard (not verified) on August 14, 2009 - 7:37pm

I'm having trouble following

I'm having trouble following this. At the macosxhints.com site, there is the instruction to modify ssl.conf file and the httpd.conf file.

Am I right in assuming that I need modify the ssl.conf and httpd.conf files in /Applications/MAMP/conf/apache

I will say that when I assume this, I am unable to get MAMP to work. The error boils down to the AddModule command in httpd not being recognized.

I'm wondering if anyone can provide some clarification as to the necessary changes that must be made to the macosxhints instructions in order for this to work with MAMP.

CmdrGuard (not verified) on August 14, 2009 - 7:38pm

I'm having trouble following

I'm having trouble following this. At the macosxhints.com site, there is the instruction to modify ssl.conf file and the httpd.conf file.

Am I right in assuming that I need modify the ssl.conf and httpd.conf files in /Applications/MAMP/conf/apache

I will say that when I assume this, I am unable to get MAMP to work. The error boils down to the AddModule command in httpd not being recognized.

I'm wondering if anyone can provide some clarification as to the necessary changes that must be made to the macosxhints instructions in order for this to work with MAMP.

  • 1
  • 2
  • next ›
  • last »

Recent

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Command Line Basics: More Editing with Vi/Vim

Video 8.31.2010

Lullabot's Back to School Sale

Blog 8.30.2010

Popular

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Photo galleries with Views Attach

Article 6.01.2009

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Announcing BeautyTips, a jQuery Tooltip Plugin

Article 10.20.2008
 
  • Home
  • Services
  • Events
  • Ideas
  • Store

Connect the Bots:

Twitter Facebook YouTube blip.tv All Posts Newsletter
  • Ideas
  • Blog
  • Podcasts
  • Videos
  • About
  • Contact
  • Jobs
  • Services
    • Training
  • Events
    • Training Workshops
    • Other Events
    • Conferences
    • Calendar
  • Products
    • Videos
    • Books
    • Swag
  • Ideas
    • Blog
    • Podcast
    • Videos
  • About
    • Philosophy
    • Team
    • Presskit
  • Contact
    • General
    • Work Inquiries
    • Mailing List