MAC platform Apache + PHP + MySql Configuration

Source: Internet
Author: User
I. There are two ways to start Apache: 1. Visually configure system offset settings-sharing and select Internet sharing. (I did not test) 2. Enter sudoapachectlstart in the command line mode. Then, enter localhost in the browser and ItWorks will be displayed! The main directory of Apache is: LibaryWebServerDocum

I. There are two ways to start Apache: 1. Visually configure system offset settings-sharing and select Internet sharing. (I did not test) 2. Enter sudo apachectl start in the command line mode. Then, enter http: // localhost in the browser, and It Works will be displayed! The main directory of Apache is: Libary/WebServer/Docum

I. Start Apache

There are two startup methods:

1. Visual Configuration

In "system offset settings"-"share", select Internet sharing. (I did not test)

2. Command Line
Enter sudo apachectl start


Enter http: // localhost in the browser and It Works will be displayed!

The main directory of Apache is: Libary/WebServer/Documents.

II. Configure PHP1. modify the apache configuration file

Set/etc/apache2/httpd. conf

Remove # Before loadModule php5_module libexec/apache2/libphp5.so

2. Set php. ini

Copy/etc/php. ini. default to/etc/php. ini and modify the content as needed.

3. Restart apache
Run sudo apachectl restart on the command line


3. Install MySql1. download and install

: Http://dev.mysql.com/downloads/mysql/, download the latest dmg archieve version. After installation, the MySql icon is displayed in the system offset settings.

2. Set the password

cd /usr/local/mysql/binsudo ./mysqladmin -u root -password root


4. Install mcrypt1.download and decompress libmcrypt-2.5.8.tar.bz2

Region ~ /Downloadssudo tar-xvf libmcrypt-2.5.8.tar


2. Compile

cd ~/Downloads/libmcrypt-2.5.8/./configure --disable-posix-threads --enable-staticmakesudo make install


3. Download the php source code file (select a version)

View php version php-v download http://cn2.php.net/distributions/php-5.5.14.tar.gztar-xvf php-5.5.14.tarcd php-5.5.14/usr/bin/phpize./configuremakesudo make installsudo vi/etc/php. ini add content extension = mcrypt. sosudo apachectl restart


5. Install PhpMyAdmin

1. Download PhpMyAdmin

Place it in/Library/WebServer/Documents/phpMyAdmin.

2. Set

Copy config. sample. inc. php to config. inc. php and make the following changes:

Used for Cookie encryption, random long string

$cfg['blowfish_secret']='fewf323';$cfg['Servers'][$i]['host']='localhost';$cfg['Servers'][$i]['AllowNoPassword']=false;

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.