What is the easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard)?
I'd prefer to use any built in versions before resorting to downloading from the PHP or MySQL websites.
I'm comfortable at the command line in Terminal.
What is the easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard)?
I'd prefer to use any built in versions before resorting to downloading from the PHP or MySQL websites.
I'm comfortable at the command line in Terminal.
I'm not quite sure as I'm not so familiar with MacOSX, but I think this will work in Snow Leopard too: http://www.macosxhints.com/article.php?story=20071030153912813
Considering it hasn't been released yet, I'm assuming this is a question for ahead-of-time or you have a developer's build. As Benjamin mentioned, MAMP is the easiest way. However, if you want a native install, the process should be like 10.5. PHP comes installed on OS X by default (not always activated for some), just download the 32-bit version of MySQL, start Apache, and you should be good to go. You may have to tweak Apache for PHP or MySQL, depending on what builds are present. I didn't have to tweak anything to have it working.
I would agree with Benjamin, either install MAMP or MacPorts (http://www.macports.org/). Keeping your PHP install separate is simpler and avoids messing up the core PHP install if you make any mistakes!
MacPorts is a bit better for installing other software, such as ImageMagick. See a full list of available ports at http://www.macports.org/ports.php
MAMP just really does PHP, Apache and MySQL so any future PHP modules you want will need to be manually enabled. It is incredibly easy to use though.
Open a good text editor (I'd recommend TextMate, but the free TextWrangler or vi or nano will do too), and open:
/etc/apache2/httpd.conf
Find the line: "#LoadModule php5_module libexec/apache2/libphp5.so"
And uncomment it (remove the #).
Download and install the latest MySQL version from mysql.com. Choose the x86_64 version for Intel (unless your Intel Mac is the original Macbook Pro or Macbook, which are not 64 bit chips. In those cases, use the 32 bit x86 version).
Install all the MySQL components. Using the pref pane, start MySQL.
In the Sharing System Pref, turn on (or if it was already on, turn off/on) Web Sharing.
You should now have Apache/PHP/MySQL running.
In 10.4 and 10.5 it was necessary to modify the php.ini file to point to the correct location of mysql.sock. This has been fixed in 10.6 and the MySQL installs now.
I got a problem running mysql it simply does not start. Preferences panel "start" button does not start it. and I get : 2:etc nacho4d$ /usr/local/mysql/bin/mysql -bash: /usr/local/mysql/bin/mysql: Bad CPU type in executable
by the way I have the first generation intel iMac (the White) and downloaded the 64-bit version of mysql. do i need a 32-bit version?
here is my the original post: http://stackoverflow.com/questions/1334272/cant-start-mysql-in-mac-os-10-6-snow-leopard
HELP please.
I've summarized all the necessary steps (tested with a clean install of Snow Leopard).
to complete your setup or mysql:
sudo vim /etc/profile
add alias
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
then set your root password
mysqladmin -u root password 'yourPassword'
then you can login with mysql -u root -p
Tried to edit /etc/apache2/httpd.conf but got a message "The document “httpd.conf” could not be saved. You don’t have permission."
I'm the only user on this computer - I'm the admin.
??
I'm new to Mac and I can't seem to find /etc/apache2/httpd.conf in my Mac OS X Snow Leopard.
it's an invisible folder. Just hit Command-Shift "G" (takes you to the Go to Folder menu item) and type /etc/ Then it will take you to inside that folder.
Has anyone tried XAMPP? http://www.apachefriends.org/en/xampp-macosx.html
I strongly prefer HomeBrew over MacPorts for installing software from source.
brew install mysql
HomeBrew sequesters everything in /usr/local/Cellar so it doesn't messily spew files all over your machine, but you'll have to symlink it to /usr/local so mysql.sock is in the expected place:
ln -s /usr/local/Cellar/mysql/5.1.xx /usr/local/mysql
(Be sure to replace 5.1.xx with your installed version.)
Then in ~/.profile I put:
alias mysql.server=/usr/local/mysql/share/mysql/mysql.server
So that you can then start and stop mysql by typing:
mysql.server start
mysql.server stop