Home
Greetings guest! members can rogu in here.
(hide this)
 
Danny's News (toggle comments)
Otaku and Japan news (subscribe) or (see more »)
Tax Payers Anime
Folks who watch Sazae-san will know that at the beginning of each show, Sazae goes round Japan looking at tour... ( more » )
Wed 07/09 17:01 comments (8)
Canal Figure
This 1/7 scale figure of Canal is based on a Yamashita Shunya illustration and will be released in October by ... ( more » )
Wed 07/09 15:00 comments (16)
School Girls Skirts
If you like school girls with short skirts then you need to go live in Kyoto. There you will see an average o... ( more » )
Wed 07/09 12:39 comments (25)
Code Geass Deleted S...
SPOILER ALERT! For some reason they deleted this from Geass EP 13. Via Neta where you can see two more. ( more » )
Wed 07/09 10:32 comments (18)
Watase Nozomi
Could this be the first PVC figure with pubic hair? This is Nozomi Watase illustrated by Tony Taka and PVC-if... ( more » )
Wed 07/09 08:08 comments (33)
Car Vending Machine
As you already know, Japan has vending machines for everything from used pantsu to vegetables. But did you kn... ( more » )
Wed 07/09 02:27 comments (43)
Pedo Bear Caption
Hijacked from NightRiver. I really liked this one ^^; Original text from NightRiver below.Not only do they... ( more » )
Tue 07/08 20:24 comments (40)
Mon 10/10 05:08 JST
So I read most of the "penultimate-tutorial-to-installing-php-mysql-apache-gd-on-tiger" and you know what? They just don't work - most of those tutorials being about as useful as having a shovel of bat shite shoved up your left nostril. But many of them did provide pointers and after looking at a zillion of these tutorials, I managed to do the PHP with GD lirary, MYSQL and Apache on Tiger thang.

This may end up being one of those lousy tutorials but it works for me every time I need to set up clean on OSX Tiger - give it a whirl and if it does not work then be angry!

Before you start
Install the Xcode tools from the installation DVD that came with Tiger - Don't install the documentation if you don't need it and save yourself 733MB of disk space.
Installing the Xcode tools will install the compiler that you need to compile stuff - otherwise you will just end up with some "compiler not installed" or some similar annoying error message.

Installing MYSQL
Get "mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.dmg" from mysql.com - mount and click on installer package. Create a file called ".my.cnf" (Don't forget the dot in front of the file name) with the following 3 lines and stick it in your /etc/ directory.

[mysqld]
datadir=/Volumes/store/data/websites/mysql_data
port=10101

Note that the "datadir" should point to your mysql data directory if you dont want it the default location. I wanted my mysql directory on a seperate volume which is why I do this - if you are just after a plain installation, you do not have to do any of the above.
At this point, you should really have some tool like InVisibles to show all invisible files on your hard drive (those beginning with a dot). When you do this however, many of your other file icons will look kind of faded out - I have no idea why this happens. You also get that annoying ".DS_Store" file everywhere - its the file which contains information on the folder that you are looking at.

Installing Apache
Apache actually comes with OSX Tiger - all you have to do ia a few wee tweaks
Under " /private/etc/httpd/ " you will find the "httpd.conf" file. Open it and uncomment the following 2 lines by removing the hash before them. Doing this allows you to use PHP by loading the PHP modules.

LoadModule php4_module  libexec/httpd/libphp4.so
AddModule mod_php4.c

About half way down the httpd.conf file, you will see the following comment...

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None

Change where it says "AllowOverride None" to "AllowOverride All". This allows you to do stuff such as freely use mod_rewite - I put all my mod_rewrite comments in the .htaccess file. mod_rewrite is an Apache module which allows you to do a ton of things include feed the cat and rewrite URLS to be search engine friendly - more on how to do this in a future post. Don't worry about this if you don't know what I am babbling on about.

If you are developing a zillion sites on your machine - you should add virtual directories in httpd.conf. Near the bottom-ish of the httpd.conf file, you will see the following.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#

Just below the above comment, you can add lines like the following...
Listen 1116
<VirtualHost localhost:1116>
DocumentRoot "/Volumes/store/guncannon/Sync/websites/somesite"
</VirtualHost>

Listen 1117
<VirtualHost localhost:1117>
DocumentRoot "/Volumes/store/guncannon/Sync/websites/dannychoo/"
</VirtualHost>

What this means is that I can have a site called "dannychoo" located at "/Volumes/store/guncannon/Sync/websites/dannychoo/" - I would access this site from my browser using "http://localhost:1117"
I can have another site called "somesite" located at "/Volumes/store/guncannon/Sync/websites/somesite" accessable on port 1116.
You can have as many sites set up this way in your httpd.conf file - just remember to restart apache after you make changes.
Two notes:
1. Restart apache using "sudo apachectl restart" - you have to make an alias first though (see bottom of this post)
2. Use a text editor like TextWangler to edit your httpd.conf file because other text editors may give you a crummy "do not have permission to save file."

Installing GD graphic Libraries
If you are going to manipulate images in PHP you need to install the GD libraries - namely the libjpeg and libpng source distributions.
Fire up Terminal located in your Utilities directory and do the following - "guncannon$" is my prompt - yours will probably be yourusername$

guncannon$ cd ~/Desktop
guncannon$ mkdir gdbuild
guncannon$ cd gdbuild
guncannon$ curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
guncannon$ curl -O http://heanet.dl.sourceforge.net/sourceforge/png-mng/libpng-1.2.5.tar.gz
guncannon$ gnutar xzf jpegsrc.v6b.tar.gz
guncannon$ gnutar xzf libpng-1.2.5.tar.gz

New we need to build libjpeg - get back to the terminal and do the following...

guncannon$ cd jpeg-6b
guncannon$ sudo mkdir -p /usr/local/include
guncannon$ sudo mkdir -p /usr/local/bin
guncannon$ sudo mkdir -p /usr/local/man
guncannon$ sudo mkdir -p /usr/local/lib
guncannon$ sudo mkdir /usr/local/man/man1

The above commands create directories that may be missing (for some reason) from your OSX Tiger. If for example you already have a "/usr/local/bin" directory - you Don't need to create it again.
Now that these directories are ready, time to lock, load, wash your armpits then build and install...

guncannon$ ./configure
guncannon$ sudo make install
guncannon$ sudo make install-lib
guncannon$ sudo ranlib /usr/local/lib/libjpeg.a
guncannon$ cd ..

Now that libjpeg is installed, we need to install libpng which is ever so slightly a pain in the left earlobe. Do the following at the terminal.

guncannon$ cd libpng-1.2.5
guncannon$ cp scripts/makefile.macosx ./Makefile

Now open the file "Makefile" that you just copied to your libpng-1.2.5 directory in TextWrangler.
Look for the following comments...

# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=../zlib
ZLIBINC=../zlib

Change the above so that it looks like the below...

# Where the zlib library and include files are located
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
#ZLIBLIB=../zlib
#ZLIBINC=../zlib

Now search for the following

LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -current_version $(PNGVER)

and change it to...

LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz

Save the changes and then go and watch Gundam Seed Destiny. When you get back, go to the terminal again and unleash the following...

guncannon$ make
guncannon$ sudo make install
guncannon$ sudo ranlib /usr/local/lib/libpng.a
guncannon$ cd ..

Now everything up until now should have gone smoothly - if not then stick in a comment to this post and tell me how angry you are.

Building and Installing PHP
We are nearly there - in no time you will be making a ton of affiliate sites to pay for your expensive hobbies (like mountain climbing with a toilet strapped to your back - expensive stuff).
Time to fire up that terminal again and do the following...

guncannon$ cd ~/Desktop
guncannon$ mkdir phpbuild
guncannon$ cd phpbuild
guncannon$ curl -O http://museum.php.net/php4/php-4.3.6.tar.gz
guncannon$ gnutar -xzf php-4.3.6.tar.gz
guncannon$ cd php-4.3.6

The next step is to configure, build and install PHP. Enter the following

guncannon$./configure --with-xml --with-zlib --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-apxs=/usr/sbin/apxs
guncannon$ make
guncannon$ sudo make install

The above takes a bit of time to run after each command so go and make yourself a cup of tomato soup with croutons - everything should be ready when you get back.
If you are a bad programmer like me, you will want to erm turn global variables on (gulp) - You will need to configure your php.ini file - do the following at the terminal...

guncannon$ cp php.ini.default /usr/local/lib/php.ini

This makes a copy of the php.ini-dist file and saves it as php.ini in your /usr/local/lib/ folder. Open the file in TextWrangler and change the line where "register_globals = Off" to "register_globals = On"
And after you have done that, make sure you spend time learning how to program without using global variables - doh!

Other stuff to do
Create some aliases to make your life just that much easier.

alias mysqladmin=/usr/local/mysql/bin/mysqladmin
alias mysqld_safe=/usr/local/mysql/bin/mysqld_safe
alias apachectl=/usr/sbin/apachectl

Which now means you can....

guncannon$ sudo apachectl start
guncannon$ sudo apachectl stop
guncannon$ sudo apachectl restart
guncannon$ sudo mysqld_safe (starts mysql)
guncannon$ mysqladmin -u root shutdown (stop mysql)

I hope this works for you as it worked for me on a clean installation of Tiger. If it does not work then you are permitted to get all wound up as I did reading other bods tutorials on the same subject.
Brock in Seattle WA
Works for me - great stuff.
What about the permissions on MYSQL?
(ID #33241) Posted on 2007/01/02 01:23
Bob Terry in London
Just what I was looking for - thanks :-)
(ID #33242) Posted on 2007/01/02 01:23
Cronus in 群馬
これの日本語版が欲しい。
お願いします。
(ID #33251) Posted on 2007/01/02 01:23
Danny Choo in Meguro Tokyo
BTW, when installing XCode tools, choose a custom install and leave out documentation to save yourself 700MBs of disk space.
(ID #33297) Posted on 2007/01/02 01:23
Mel Beckman in Santa Barbara, CA
Bless you, Danny! This was precisely what I needed to get ACID up and running for Snort!
(ID #33321) Posted on 2007/01/02 01:23
Emil Babin in Denmark
Hi Danny Choo
You probably get a lot of this, but I'll give it shot anyway:

I followed your tutorial on installing the gd lib on OSX Tiger and everything went fine up untill the point where you build and install libraries:

guncannon$ ./configure
guncannon$ sudo make install
guncannon$ sudo make install-lib
guncannon$ sudo ranlib /usr/local/lib/libjpeg.a
guncannon$ cd ..

When I hit "emil$ ./configure", this is what I get in return:

emil-babins-imac-g5:~/Desktop/gdbuild/jpeg-6b emil$ ./configure
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

... what gives?
If you have any idea, it will be very much appreciated as I don't have a clue of what I'm doing...

thx Emil
(ID #33371) Posted on 2007/01/02 01:23
Danny Choo
Hi Emil,

Yep I saw these errors when i first started off - you are getting these messages because you do not have a compiler installed - installing all of the xcode tools from the DVD that came with your mac should fix these problems.

Let me know how it goes.
(ID #33372) Posted on 2007/01/02 01:23
Brock in Seattle WA
Works for me - great stuff.
What about the permissions on MYSQL?
(ID #75245) Posted on 1999/11/30 14:12
Bob Terry in London
Just what I was looking for - thanks :-)
(ID #75246) Posted on 1999/11/30 14:12
Cronus in 群馬
これの日本語版が欲しい。
お願いします。
(ID #75255) Posted on 1999/11/30 14:12
Danny Choo in Meguro Tokyo
BTW, when installing XCode tools, choose a custom install and leave out documentation to save yourself 700MBs of disk space.
(ID #75301) Posted on 1999/11/30 14:12
Mel Beckman in Santa Barbara, CA
Bless you, Danny! This was precisely what I needed to get ACID up and running for Snort!
(ID #75325) Posted on 1999/11/30 14:12
Emil Babin in Denmark
Hi Danny Choo
You probably get a lot of this, but I'll give it shot anyway:

I followed your tutorial on installing the gd lib on OSX Tiger and everything went fine up untill the point where you build and install libraries:

guncannon$ ./configure
guncannon$ sudo make install
guncannon$ sudo make install-lib
guncannon$ sudo ranlib /usr/local/lib/libjpeg.a
guncannon$ cd ..

When I hit "emil$ ./configure", this is what I get in return:

emil-babins-imac-g5:~/Desktop/gdbuild/jpeg-6b emil$ ./configure
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

... what gives?
If you have any idea, it will be very much appreciated as I don't have a clue of what I'm doing...

thx Emil
(ID #75375) Posted on 1999/11/30 14:12
Danny Choo
Hi Emil,

Yep I saw these errors when i first started off - you are getting these messages because you do not have a compiler installed - installing all of the xcode tools from the DVD that came with your mac should fix these problems.

Let me know how it goes.
(ID #75376) Posted on 1999/11/30 14:12
Previous Articles
Google maps Japan
comments(2)
All your base are belong to us
comments(3)
CSS replace tables
comments(0)
Skype VS Gizmo
comments(2)
English and Japanese RSS
comments(0)
Longer address bar in Firefox
comments(0)
100Mbps connection
comments(11)
Firefox SEO extensions
comments(0)
LetterJames
comments(1)
Firefox 1.0 RC 1
comments(0)
Broadband you say?
comments(1)
Articles being read right now...
Qubeley
comments(28)
Traffic Accidents in Japan
comments(34)
USB Powered PG Gundam
comments(20)
Darker than Black
comments(53)
USB Mask
comments(36)
Sugoi Itasha
comments(26)
Japan Proprietorship
comments(22)
Gundam Exia
comments(47)
McDonalds Virus
comments(52)
Japanese New Year
comments(48)
Another Century's Episode 2
comments(32)
A week in Tokyo 3
comments(48)
dannychoo.com ( Creative Commons ) ( Danny Choo ) ( Anime, Gundam, Figures, Japan ) Since 2000
Eroge
リトルバスターズ!  エクスタシー 初回...
1.リトルバスターズ! エクスタシー 初回...
2008/07/25 14:12
¥ 7,980
Idol DVD's
VIBES
1.VIBES
2008/07/30 14:12
¥ 2,265
DVD BOX
ROOKIES  表BOX
1.ROOKIES 表BOX
2008/07/18 14:12
¥ 6,125