There are a few separate software in Mac OS X that can facilitate your amp development, such as Mamp. This way you can have a clean and additional development environment, which is also very convenient to use. This article is not about using all of the software in one. Instead, take advantage of the Apache PHP that comes with Lion and install MySQL for development.
Lion has its own Apache and PHP, so for these two we do not need an additional installation, using ready-made, just need to modify the configuration file/etc/apache2/httpd.conf
Let go of the line that was originally commented out:
#LoadModule Php5_module libexec/apache2/libphp5.so
Delete the previous #
Another note:/etc/php.ini.default changed to/etc/php.ini then the parameters of which modify the restart Apache2ctl graceful can take effect.
The sharing web sharing on the system preference will then open Apache.
Test: Http://localhost/~[username]
will open ~/sites/index.html
Then go to mysql website download mysql for Mac OS X 10.6, there are DMG files, after loading the mysql-5.5.15-osx10.6-x86_64.pkg will install MySQL to/usr/local/ Under the mysql-version. and establish symbolic links for/usr/local/mysql. If you need to start automatically, you can also install the mysqlstartupitem.pkg once, this only need to install once, and later upgrade no need to install.
After installation, you can use the command
Sudo/library/startupitems/mysqlcom/mysqlcom start to launch
There is no password by default. For security, we add our own password (several root users and several anonymous users):
/usr/local/mysql/bin/mysql-u Root
Connect to the database,
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' newpwd ');
mysql> SET PASSWORD for ' root ' @ ' 127.0.0.1 ' = PASSWORD (' newpwd ');
mysql> SET PASSWORD for ' root ' @ ' host_name ' = PASSWORD (' newpwd ');
mysql> SET PASSWORD for ' @ ' localhost ' = PASSWORD (' newpwd ');
mysql> SET PASSWORD for ' @ ' host_name ' = PASSWORD (' newpwd ');
That's all you can do.