Configuring Apache PHP and MySQL environments in lion

Source: Internet
Author: User
Tags apache php ini php and php and mysql

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.