Set up the WordPress personal site environment on Mac

Source: Internet
Author: User
Tags install wordpress

Freshman's first exposure to new things in the company's background is always curious.

However, the company uses the traditional SSH framework to build the background, so we basically have been writing business and writing business.

In addition, a friend copied a website for downloading XX movies, and suddenly raised my desire to build a personal website.

No Web experience, no development experience for large websites, no practical development experience in CSS, JS, and HTML.

Are you familiar with the overall building process?

I. Site Building Environment

Someone suggested that I use xxmap to play first.

However, considering that I originally set up the Resin server in the background of the Development Company, and Mac itself brought Apache and PHP pre-installed.

I decided to install a MySQL.

So my environment is Apache + PHP + MySQL. (Nginx has been deployed recently, but there are various inexplicable errors .)

Ii. Software Installation and basic configuration and startup

1. Apache

Pre-installed in MAC system.

The installation directory is in/etc/apache2;

The default website directory is in/library/webserver/document;

The configuration file is httpd. conf in the installation directory.

To support PHP, you must enable

# Loadmodule php5_module libexec/apache2/libphp5.so

Remove.

Enable sudo apachectl start

Enter localhost in the browser to view it work!

2. php

MAC system pre-installed

Copy a default PHP configuration directly, from my configuration

$ Sudo CP/etc/PHP. ini. Default/etc/PHP. ini

3. MySQL

There are two ways to install MYSQL: Installation Package and compressed package.

I accidentally selected a compressed package.

/******* For detailed installation, stamp this blog ******/

Go to the MySQL official website mysql-5.1.54-osx10.6-x86_64.tar.gz http://dev.mysql.com/downloads/mysql/5.1.html

Remember 64-bit. Because python in Mac is 64-bit, 32-bit MySQL cannot be used in Python.
Download the package, decompress it, and then run the following command in terminal:

$ sudo mv mysql-5.1.45-osx10.6-x86_64 /usr/local/mysql
$ cd /usr/local
$ sudo chown -R mysql:mysql mysql
$ cd mysql
$ sudo scripts/mysql_install_db --user=mysql
$ sudo chown -R root .
$ sudo chown -R mysql data

Then use CD Bin
$ sudo ./mysql_secure_installation 
To modify the root password. The default value is null, which is obviously not safe. Configure the password as prompted, because the development environment does not have to be so restrictive.

$ sudo ./mysqld_safe 
To start MySQL

$ sudo ./mysql -u root -p 
Enter the root password you just set to log on to MySQL.

$ sudo ./mysqld_safe stop 
Stop MySQL

/**************/

I basically follow this.

At that time, there was usually a problem in the middle.

MySQL. Sock file not found at startup

You need to manually create

Touch/tmp/MySQL. Sock

Environment configuration complete

3. Install Wordpress

Drag the WordPress template to/library/webserver/Document

Access the site through the stream browser localhost/WordPress

Configure the database as prompted and initialize the database as required by WordPress.

Several problems may occur here.

Problem 1: Can't connect to local MySQL server through socket '/var/MySQL. Sock'

This is why PHP wants to connect to MySQL.

It is said that these areas have changed after the system is upgraded.

PHP found the folder by default, but we put mysql. Sock under/tmp, so the simple method is

Sudo Vim/etc/PHP. ini file

MySQL. default_socket =/tmp/MySQL. Sock

Question 2: prompting you that permission issues cannot create wp-config.php,

This is because our website has a directory under/library. If you have a permission problem, you can create this directory manually and paste the content.

Over

Backup

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.