Loading
FOKUS Menyajikan Ulasan-Ulasan Bernuansa Berita Dan Gaya Hidup Terpercaya

Trying something new . . . again (part 2) (Moving an xampp installation on Mac OS X)

I spent most of the day dealing with MS SQL Server Express and converting a database to MySQL (more on that later, hopefully), but then I came home and happened to restart my laptop, which is what the last post was about.

I did manage to move the XAMPP folder to another directory and out of /Applications. I chose to move it to /Users/Matt/xampp, so that if I need to upgrade in the future all my server stuff will remain intact if I use Migration Assistant. I also pointed the server at /Users/Matt/Sites rather than XAMPP's own htdocs so that all my web stuff was still in the same place.

To do this, I created one symbolic link and modified two files.

1. To create the symbolic link in /Applications that would point to /Users/Matt/xampp/, I opened Terminal and ran this command:
ln -s /Users/Matt/xampp /Applications/xampp

2. To point the XAMPP Apache server at the new folder, I changed this line in /Users/Matt/xampp/etc/httpd.conf from
ServerRoot "/Applications/xampp/xamppfiles"
to ServerRoot "/Users/Matt/xampp/xamppfiles"

In fact, I seem to have been overzealous and changed every instance of that path in httpd.conf, which probably wasn't necessary, since we can usually trust the symbolic link to do its job.

3. To get MySQL to be recognized, I changed the location of the socket (mysql.sock) in /Users/Matt/xampp/etc/my.cnf from
socket= /Applications/xampp/xamppfiles/var/mysql/mysql.sock to socket= /Users/Matt/xampp/xamppfiles/var/mysql/mysql.sock
Again, this may not have been necessary, but things work now and I don't want to mess them up again.
You may feel pretty cocky now and want to change the setting for mysql.default_socket = in php.ini. This will most likely break your connection between PHP and MySQL, and I'm not sure why.

So there you go: your very own XAMPP server, sitting inside your Home folder where it will be nice and protected.

0 komentar:

Posting Komentar