Mac 上で Drupal 開発環境を整えるには "How to set up an environment for Drupal development on Macintosh platform"

Events happening in the community are now at Drupal community events on www.drupal.org.
Shin-gdo_J's picture

◆2010/03/20 追記
このスレッドは最初『MAMPを使うメリットについて(特にデザイナーとして)』というタイトルで開始しましたが、様々な方にコーディング、プログラミングにも役立つアイデアやツールの紹介をしていただき、MAMP、デザインに限らない内容に広がってきたので標題の通りに変更いたします。
提案してくれた aiwata55 さん、ありがとう。

《following is the original topic》

『MAMPを使うメリットについて(特にデザイナーとして)』

つい先日新しい MacBook(と言いつつ、2006年の中古マシン(^^;; 一応 Intel inside)を手に入れて、Snow Leopard をインストールし、なんとか現用機(さらに古い、PowerMac G4 QuickSilver 2001 っていう超ロートルマシンw)からの環境移行を終えようとしています。
3月中に終えなきゃいけない結構でかいサイト構築があるので、こんな時期にそんなことやるなって話なんですが。

で、以前月例勉強会・ミーティングでお会いした Mac ユーザーの皆さんが、ほぼ例外なく MAMP を導入していることを思い出しました。
これ以上、実際の制作を遅らせるわけには行かないのですが(汗)、「MAMP は入れるべき!」と力説されていた方が少なくなかったのも併せて思い出しました。

具体的にどんなメリットがあるのか、Drupal でのサイト構築に絡んだメリットがあれば、あらためてご教示いただければと思い、書かせていただきます。

お会いしたほとんどの方がプログラム畑でいらっしゃるので、僕のようなデザイン畑の(それもほとんどプログラムの知識のない)人間にもメリットがあるのかよくわからないのですが、特にその点についてもご存じの方がいらっしゃればよろしくお願いいたします。

あと、インストールする際になにか気をつけることとか、一緒に入れた方がいいものなどあれば、併せてお教えいただければありがたく存じます。

Following is the brief translation in English.

I've just got my new MacBook (in fact, some 3 years old model) and have installed Snow Leopard and my old data and settings on it.

I remember that not a few Mac users I met at the monthly meeting installed MAMP on their Macs, and almost all of them strongly told me that MAMP was the important tool everybody must install.

Would you please tell me again the advantages/merits of using MAMP as the web programmers/designers constructing web site using Drupal ?
Especailly I want to know whether just the designer like me who don't know about programming at all get something special from using MAMP or not.

Additionally, if there are some points I have to care about installing MAMP and other useful tools or something that I should install with MAMP, please let me know.

Thank you in advance.

Shin
//This year's Formula One Grand Prix is now ON-THE-GOOOOOOOOO !!!! :-)

Comments

Less headaches

FilmKnurd's picture

Well, you're going to want to install MAMP if you just want to be able to be up and running Drupal without having to compile PHP (Snow Leopard's version is incompatible with Drupal), and manually maintain virtual hosts for each project.

With MAMP (especially MAMP Pro), you have a self contained webserver environment that's push button easy.

Snow Leopardではどちらでも良いかもですが。

okdt's picture

Mac OS X 10.4 and 10.5のPHPはnativeのPHPではありませんでした。また、MySQLのインストールも面倒。MAMPの最新版はPHPこそ5.2.0ですが、phpmyadmin含めMySQLとのインターフェースもわかりやすく、ポート番号さえ押さえればとても簡単です。

Snow Leopardに同梱されているPHPでは、大した問題もないと思いますが、いずれにしてもMySQLはメンテしなければなりません。

その手間を考えるとMAMPでいいじゃん、ということかもしれません。

Thanks

Shin-gdo_J's picture

@FilmKnurd
@okdt

コメントありがとうございます。
お二人のおっしゃっている内容が完全には理解できない僕には、MAMPは難しいですかね(汗

PHPにいろいろなバージョンがあるということくらいは存じていますが、組合せでいろいろ使えたり使えなかったりするんですね。

その手間を考えるとMAMPでいいじゃん、ということかもしれません。

っておっしゃってるのを読むと、逆に、MAMP(としてひとまとめに)インストールしちゃえばそういうことを考えないでも動く環境ができる、ということでしょうか。

Thank you for commenting.
It seems difficult to use MAMP for me who can't understand what you two means entirely. :-p

I know we have several versions of PHP, and with Drupal we have to select the right version of them, am I right?

But reading what you two says, if I install MAMP, can I use it easily without thinking of that kind of troublesome things ?

Yes. MAMP is perfect for you

FilmKnurd's picture

Yes. MAMP is perfect for you because you don't have to think about the technical stuff, it's just turn it on and it works :-)

@FilmKnurd

Shin-gdo_J's picture

Oh, thank you again telling me that.
Then I'll install MAMP ASAP. :-)

Other Tools

FilmKnurd's picture

As a designer on a Mac, I think CSSEdit 2 is an absolute must :-) It will save you a ton of time. For a free text editor, Text Wrangler isn't bad. And if you need an IDE for working with PHP and version control (SVN, CVS, and Mercurial) then I recommend NetBeans.

Thanks

Shin-gdo_J's picture

Thanks for telling me those useful tools.
I think I have to search those because I don't know some of them at all.

aiwata55's picture

ほかの方法と比較したわけではないですが,ともかく Drupal 開発のための環境がすぐに構築できるということに尽きると思います。と言いながら,僕自身はサーバーの操作・管理を学ぶために,Parallels で Ubuntu を動かし,Ubuntu 上で Drupal を使っていますが。

I think the biggest benefit of using MAMP is that you can build a development environment for Drupal so easily and quickly, although this is my impression without comparison to other solutions. Having said that, I am using Ubuntu on Parallels in order to learn how to administer a typical LAMP server.


Aki Iwata
FOREST & trees

Ubuntu

Shin-gdo_J's picture

@aiwata55さん、コメントありがとうございます。

へぇ〜、Ubuntu ですか。Server バージョンなのかな?
単体でPCに入れて使ってはいますが(デスクトップ版ですけど)。
たしか、以前 dokumori さんも同じことされてると聞いた覚えがあります。

僕はお金がないのでw、Virtualbox を入れて Windows をとりあえず入れて使ってみましたが、思いの他サクサク動くのにビックリ。やっぱり intel Mac にした甲斐があります(^^;;

Ubuntu も入れてみようかな? 

よかったら、Ubuntu 上で Drupal を使うメリットを簡単に教えてもらえませんか?
使ってみれば一目瞭然なのかな。英文の方を読むと、それに LAMP を入れるわけですよね。

LAMP を入れるというより

aiwata55's picture

LAMP を入れるというより,LAMP を構築する,という感じでしょうか。LAMP (Lynux, Apache, MySQL, PHP) のうち,Ubuntu を使うことですでに Lynux の部分は持っていることになります。で,tasksel install lamp-server というコマンドをターミナルに入力すると,それだけで残りの Apache,MySQL,PHP が手に入ります。これで,Drupal だろうと WordPress だろうと動かす基本的な環境の構築ができます。

実際には,使う Ubuntu のバージョンによっては使用するレポジトリを書き換える必要があったり,ImageCache の機能をフルに利用するには PHP を自分でコンパイルしなおさなきゃいけなかったりと,ちょこちょことやる事があるのですが。

自分で LAMP を構築した場合,なにか重大なミスをしたとしてもホスト OS である Mac OS X には一切影響しないという点,そして Apache の VirtualHost を使って,リソースが許す限りいくらでもサイトを追加できるという点が気に入っています。


Aki Iwata
FOREST & trees

あ、な〜るほど

Shin-gdo_J's picture

#危ないタイトルだww

構築する、んですね。
具体的なコマンドまで教えていただきありがとうございます。じゃあ、そっちもやってみようかな。
と言いつつ素朴な疑問として、Mac をお持ちで MAMP があるのに、あえて Ubuntu でやる理由はあるのでしょうか?
あと、いろいろ面倒くさそうでもあるんですね(汗

Shin
//Now I've noticed you wrote "I proudly drip Drupal's delicious drops."
//It sounds really good and I would like to follow you! :-)

Mac をお持ちで MAMP があるのに、あえて

aiwata55's picture

Mac をお持ちで MAMP があるのに、あえて Ubuntu でやる理由はあるのでしょうか?

鋭い質問ですね。理由は,本番環境に近い開発環境を持つことで,本番に移行したときのトラブルを最小限に抑えたい,ってところでしょうか。

あと、いろいろ面倒くさそうでもあるんですね(汗

はい,面倒です。でも面白いし,自由度が高いと思います。先述の VirtualHost なんかは,無償版 MAMP ではできないようですし。


Aki Iwata
FOREST & trees

qchan's picture

私もMAMPを使ってます。
やはり、非常に楽ですよ。
操作を間違ってもMac本体に影響しないのでいじるのが気楽です。

気に入ったら、有料版MAMP Proもおすすめです。
htdocs以下に複数のサイトを並べたとき、

http://localhost/xxx.com/

などとなるんですが、これをブラウザで見るときに

http://xxx.com/

と打っても表示できるようにしてくれるので、document rootからの絶対パスなどで
画像やCSSを当てているときにズレがないので助かります。
TereminalからHostsファイルを書き換えたり、drupalのsettings.phpをいじらなくても
良いですからこれは大変便利です。

EditorはCodaを使ってます。デザインも良いし、FTP、SVNの連携もあってもう手放せません。

@qchan

Shin-gdo_J's picture

具体的な話をありがとうございます(^_^)v

この例って、あくまでもPro版だけの話? たしかにこれができるとすごく便利だろうというのはわかります。
ドシロウトの質問もいいところなんですが(汗)この設定をしちゃうと、いつでもローカルホストの方を読みに行って、永遠に外部に行けないなんてことにはならない?(^_^)ゞ 設定を簡単に切り替えられるんでしょうか?

あと、Codaって名前も以前お会いした時にチラッと伺った記憶を思い出しました。調べてみます。

いずれにしろ、皆さんの話をお聞きすると、やはり Drupal(っていうかサイト開発)にもっと深く取り組むとなると、MAMP は入れておいた方がよさそうですね。

Thank you for those who was kindly enough telling me the merits of MAMP.
I really appreciate it.

Shin
//I've ordered Adam Lambert's "For Your Entertainment" and am really looking forward getting it.
//Now I'm reading "The Bat, the Birds, and the Beasts" again. It's fun. :-)

Coda

Shin-gdo_J's picture

すみません、Codaってこれのことなんでしょうか?

●パニック・ジャパン - Coda - Mac OS X 用 シングルウインドウ Web 構築環境
http://www.panic.com/jp/coda/

単なるエディタのつもりでここを見に行ったら、もっと大げさな“統合開発環境”みたいなものなので、あれ?もしかして違うのかな、とw

I use Coda, and like it a

Garrett Albright's picture

I use Coda, and like it a lot. One thing I must absolutely have in an editor is the ability to split the editor window vertically and show two different files in each frame. Many editors are capable of doing this horizontally, but not vertically. Coda does that; not quite as well as Smultron, my previous favorite editor, but well enough.

I use Coda pretty much only as a text editor. It has a lot of extra features, like web preview, a graphical CSS editor, built-in manuals, etc, but they're all lost on me… I just want a text editor. So Coda's actually a bit overkill. I still think it's a good value, though.

Codaを使っています。一番Macのエディタだと思いますでもかんぺきじゃありません。

I personally don't use MAMP; I prefer to install the web server, PHP, etc using MacPorts, which is similar to the ports system for the BSD Unices. I'm sure there's nothing wrong with MAMP, but I originally learned how to install this stuff using MacPorts before MAMP was available, so I'm familiar with it - and getting it all set up and configured is definitely a learning experience. (I also prefer to use Lighttpd instead of Apache.)

MAMPを使いません。Macportsでそのソフトをインストールするのが好きです。

Other useful Mac web development tools are Sequel Pro, a graphical MySQL database tool, and MacGDBp, a PHP debugger. Unfortunately I don't think either have Japanese versions.

Sequel Pro (MySQLエディタ)もMacGDBp (PHPデバッグプログラム)もいいです、でも和訳がないと思います。

Thanks, Garrett

Shin-gdo_J's picture

Thank you, Garrett, for your detailed explanation.

I'm very interested in Coda and testing it just now.
In fact, I'm always using and accustomed to Dreamweaver for designing sites.
Maybe you and other programmmers often use (dedicated) editors for developping, so there's something different to demand for tools between programmers and designers.
Are there any strong merits to change my coding tools from Dreamweaver to Coda?

I don't know MacPorts and other tools for development you introduced, and try to study and test them.
I know Lighttpd webserver program which is compatible to Apache. Now I know it is used at Youtube, Wikipedia ...

I don't care if Japanese versions are not available because I can read English. To tell the truth, I use MacOS and other applications as English mode because that displays much cooler interfaces compared to Japanese mode.
But maybe some tools like Sequel Pro and MacGDBp for programming uses are not neccessary for me as a designer. :-p

Shin
//May you (...I) be in heaven half an hour before the devil knows you're (...I'm) dead. hehehe :-p

Deleted.

aiwata55's picture

間違えて重複投稿してしまったので,削除しました


Aki Iwata
FOREST & trees

WOW

Shin-gdo_J's picture

This is incredible and amazing !! :-o

Thinking of the share of Dreamweaver these days, it's rather natural that we can get these kinds of tools, know-hows and tips and so forth, I suppose.
Anyways I'll also test this and compare to Coda, and decide which will best suit me, or I should use both as well.

Thank you very much for telling me this information.
...And also for your recent efforts you've made devotedly (...yeah, I must say) to this community ! :-)

Shin
//Now I really feel happy to get an Intel Mac even though it's an old one.

aiwata55's picture

そんな感謝されるような大層なことはやっていませんが,そう言われてもおかしくないように,これからもがんばりたいです :-)


Aki Iwata
FOREST & trees

With regards to Coda vs

Garrett Albright's picture

With regards to Coda vs Dreamweaver, I think Dreamweaver is definitely more oriented towards graphical page editing, so its code editing features are more of an afterthought compared to Coda, where code editing is the main feature. For me personally, Dreamweaver doesn't have features that I feel I need in an editor, such as vertical window splitting (as mentioned above) and regular expression-powered find-and-replace. But if you already feel comfortable using Dreamweaver and it does what you need it to do, then no need to change - whatever gets the job done for you. なんでもいいよ。

Coda is alright, but once you

FilmKnurd's picture

Coda is alright, but once you get into PHP development, <a href="http://www.netbeans.org>NetBeans is the way to go :-) It has a drupal plugin and will auto-complete the Drupal API along with real-time syntax checking. NB is also integrated with XDebug so stepping through Drupal code is simple (I also use MacGDBP, but I find NB works better for me). Finally, NB has CVS, SVN, and Mercurial support built in, so you can check Drupal out using CVS, create a NB project, and then version your sites folder in Mercurial and you're off and running with version control :-)

I can't stand NetBeans… It's

Garrett Albright's picture

I can't stand NetBeans… It's so ugly and un-Mac-like. Unfortunately, Coda does some un-Mac-like things too, particularly in regards to text selection, but at least it's usable and you can look at it without feeling the urge to reach for a sack. Too often cross-platform programs end up bringing their Windows and/or X11 look and feel into the Mac world and it's just never pretty - see also Firefox, Thunderbird, Photoshop, Opera, etc.

I do love Mercurial, though.

I totally agree with you

FilmKnurd's picture

I totally agree with you about the NetBeans UI. I generally use TextMate for all my text editing, but when it comes to module development, NetBeans is just so convenient and usable.

dokumori's picture

とりあえずDAMPを使ってみては?

http://acquia.com/downloads

@dokumori

Shin-gdo_J's picture

お久しぶりです♪

で。

うぉっ!
こんなものまであったんですね。とりあえず、基本的なことがわかってないこんな僕には最適そうですね(^^;

教えていただき本当にありがとうございます。
スレッド立てた甲斐もあったかな(^o^)/

Shin
//I'm looking forward seeing you again someday, in the near future. :-)

とりあえず

Shin-gdo_J's picture

ダウンロードなうw

風呂入って寝るのでインストールはあしたにでも(笑)
楽しみ、楽しみ(^_^)v

と言いつつ

Shin-gdo_J's picture

すでに入れてしまった♪
あっさりオーケー(^_^)v すでにサイトができているw

こんなものまでこんなに簡単なんて、Movable Type 2.26? のときはインストールすら四苦八苦しながらやったのに、まさに隔世の感。
dokumoriさん、皆さん、ありがとう!

I've just installed DAMP on my MacBook. Easily. Already got the first site of mine. :-p

I'm really impressed that these kinds of environment are so easy to be installed, comparing that I was really upset to install Movable Type 2.26.

Thank you again, dokumori and other kind folks here!

Only local images are allowed.

ローカルに

Shin-gdo_J's picture

サーバーにアクセス後の雲の上でw見慣れた apache とか mysql とかのディレクトリがあるのが新鮮。

なんかすごいことをやってるような錯覚に陥ります(<アホw)。
っていうド(×10)シロウトですが、これからもどうぞよろしゅうに(^o^)/

Shin
//Now I have to make it. :-)

だいぶ話が大きくなってきたので

aiwata55's picture

話題が MAMP に限らずだいぶ大きくなってきたので,タイトルが議論の現状を表すように,タイトルを変更してはどうでしょう? そしたら,たとえば Ubuntu とか Coda とかの,MAMP 以外のことを知りたい人もタイトルを見てこのスレッドを開いて,目当ての情報に行き着けるかもしれませんし。

「Mac 上で Drupal 開発環境を整えるには」などというタイトルはどうでしょう?

Since now this thread covers not only MAMP, I suggest to change the title to make it more descriptive. Then, someone who is looking for information about Ubuntu or Coda or something else other than MAMP may open this thread and find the info which he/she was looking for.

How about "How to set up an environment for Drupal development on Macintosh platform" ?


Aki Iwata
FOREST & trees

Sounds good

Shin-gdo_J's picture

いいですね。それいただきます(^o^)/
英語の方も多いので「Mac 上で Drupal 開発環境を整えるには」"How to set up an environment for Drupal development on Macintosh platform" と日英併記しておきますか♪

実のところ、僕には少々難しくなってきましたが(笑)スレ立てた者としては反響があってうれしく思います。

Sounds good. I'll change the title as you suggest.
It may be convenient to write it down both in Japanese and English for we have not a few English speakers (writers).

To tell the truth, as for me, things are going difficult and not directly related to my work, but I'm very glad to see the topic spread so widely.

Thanks.

Shin
//I like recently opened "radiko.jp" IP radio service because I love the program "Grooveline" on J-WAVE (especailly the personality Fumika Hideshima) and now I can listen to it whenever and wherever I use my Mac.

PHP のメモリー上限

aiwata55's picture

インストールする際になにか気をつけること

使用するモジュールによっては,php.ini ファイルを編集して PHP が使用できるメモリーの上限値を引き上げる必要があるかもしれません。ImageCache を使うなら,たしか最低でも 90MB ぐらいを割り当てないといけなかったと思います。必要なメモリーの量は,使用するモジュールによって変わるので,一概にいくらにした方がいいとは言えませんが。

MAMP では,php.ini は以下の所にあるようです。
Applications/MAMP/conf/php5/php.ini
これをエディターで開きます。
編集する箇所は,memory_limit = ... というところです。


Aki Iwata
FOREST & trees

Deleted.

aiwata55's picture

またダブルポストです。たびたび済みません。


Aki Iwata
FOREST & trees

aiwata55's picture

ゲスト OS から MAMP 上のサイトにアクセス

以下の記事に興味をもつ人がいるかと思ったので,掲示しておきます。
http://www.studio-fix.com/blog/kaoru/2010/02/05/post1095/

DAMP 環境でも有効な手法かどうかは分かりません。

Access sites served by MAMP from guest OSes.

I found the following article might be interesting to some people.
http://www.studio-fix.com/blog/kaoru/2010/02/05/post1095/

I don't know if this technique is still useful for the DAMP environment.


Aki Iwata
FOREST & trees

興味を持った

Shin-gdo_J's picture

興味を持った人がここにひとりw
で、早速、いま自分の DAMP 環境に合わせて設定をしているんですが、うまくアクセスできません。

この記事の最後の最後のところ《4. ゲストOSでWordPressへアクセス》で

 IEを立ち上げて…以下のURLにアクセス。
 http://192.168.1.2/wordpress/

とあるんですが、この 192.168.1.2 ってどっから出てきたものなんだろう? そんなサーバーねぇよ、って言われてしまう(汗
Apache の VirtualHost や、VirtualBox の共有フォルダの設定等はちゃんとやったつもりなんですが、最後で躓いてます。

直接このサイトの人に聞いてみようかなぁ(^^;

◆2010/03/23 00:55 追記
参考になりそうなサイトのメモ
大家メモ/MAMP/Mac OSXローカルにMAMPでサイト制作環境を構築 - アークウェブWebデザインSandBox
Macでローカル開発サーバ ( MAMP +バーチャルホスト) | TechGaga
MAMP環境にポート番号なしで接続する | WebScripter.jp
Nishiaki's Log: MAMPとParallelsの開発環境メモ
MacBookにParallels(パラレルズ)でWindowsをセットアップ! ~web開発環境編~ (treasuring misc.)

Shin
//Too difficult to understand ... for me :-p

dokumori's picture

Macのシステム設定内のネットワーク設定を見ると、マシンのIPが分かります。192.168.1.2とか、そういう数字が見つかるはずです。acquia stackのapacheのポート番号は8082と仮定すると、VirtualBoxのブラウザのアドレスバーに192.168.1.2:8082と入れればacuia stackのdrupalが見えるはずです。
上記の「mamp環境にポート番号なしで接続する」と同じように、acquia stack のコントロールパネルでapacheのポート番号を変更すれば、':8082' を付加せずにアクセスできるようになると思います。

うーむ

Shin-gdo_J's picture

@dokumori

これはとっくにトライしてみてたんですがなぜかアクセスできなかったんですよ。
でも、いまやってみたらアッサリw

だとすると、この記事(ローカルMac環境に構築したWordPressにVirtualBoxのゲストWindowsでブラウザアクセス)はそもそも意味がないというか、わざわざ設定しなくても読めるなら、とりあえずどういうふうに見えるかを見るだけならこれで事足りるのですが。

とにかくありがとうございました。せっかくなのでもうちょっといろいろ調べてみたいと思います。

Shin
//I’m writing this at THE WindowsXP on VirtualBox, but as was expected I find out again that I don't like Windows. :-p

Espresso

aiwata55's picture

Mac 用多機能エディタで,Espresso というのもあります。僕は,以前 MacHeist かなにかで安売りしていたのを買って以来,これを使っています。sugar という機能拡張のシステムを持っていて,対応する言語を追加できます。この中には Drupal API をサポートする sugar もあるので,たとえば

<?php
drupal_g

と入力すると,自動的にメニューが表示されて,
drupal_get_breadcrumb
drupal_get_content
drupal_get_css...
といった“drupal_g”から始まる関数名がずらっと出てきます。この中から目当てのものを選ぶと,その関数が必要とするパラメーターまで含んだ syntax が挿入されます。なかなか便利ですよ。

There is another multi-functional editor for Mac, called Espresso. I have been using it since I bought it at a discounted price sold at somewhere like MacHeist. It has an expansion system called sugar, which enables the user to add more language. There is a sugar for Drupal API, and with it Espresso suggests strings you might be trying to enter.

For example, when you type

<?php
drupal_g

then a menu will pop up, and in that menu are functions which start with "drupal_g" such as:
drupal_get_breadcrumb
drupal_get_content
drupal_get_css...
then you can choose the function you were looking for. Espresso automatically adds parameters the function takes. It is quite handy.

http://macrabbit.com/espresso/
http://fileability.net/coffee/sugar/drupal.sugar


Aki Iwata
FOREST & trees

日本 コミュニティ: Drupal Japan User Group

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: