Install and deploy WordPress

Source: Internet
Author: User
Tags format definition mysql gui mysql gui tools
Preface

Today, I want to play WP, which has been around for a long time. I am not familiar with Apache, PHP, and MySQL when I build a runtime environment in my notebook, but I don't want to install the software with one click. It's no pleasure. Searching for information on the Internet and loading and learning are quite interesting. The detailed problems I encountered once caused me to crash and it was difficult to find a solution on the Internet. It took me one afternoon to find a solution to all the problems and successfully set up my own WP environment, fun is here:-D. Of course, this article will not fully record how to install the WP environment step by step, because many people have already written poorly, and I will use the results of our predecessors directly, this article mainly introduces how to solve some of the problems encountered, hoping to help you!

Environment Construction

The servers running WP can be IIS or Apache. However, because WP is written in PHP and the database is MySQL, the efficiency of Apache + PHP + MySQL combination is much higher. I also built it in this combination. For detailed procedures, see Apache + PHP + MySQL combined installation and deployment. Apache is 2.2.17, PHP is 5.2.17, and MySQL is 5.0.22.

Note that vc9 in the latest PHP version is used together with IIS, and vc6 compilation is applicable to Apache. In addition, there is no need to add the PHP path to the environment variable. However, you must add "loadmodule php5_module D:/PHP/php5apache2. dll phpinidir" D:/PHP "" to the Apache configuration file. Otherwise, the MySQL module cannot be loaded. Refer to php5.3 and Apache configuration to solve the parameter configuration problem during PHP installation.

In addition, it is worth noting that it is best to use UTF-8 encoding during the installation process. For example, if you need to specify the encoding method during MySQL installation, We will select UTF-8, which can be modified later. Because the WP page shows that the encoding method is UTF-8, you must change the encoding mode. I specified GBK encoding in MySQL installation, and the results are garbled everywhere.

After the running environment is set up, refer to step 5 of WordPress installation to deploy the WP service. In this process, I also encountered a very troublesome problem.

Install. php garbled

Modified according to reference documentWp-config-sample.phpFile, found in install. PHP page garbled, only a line of messy things can be seen, find n more information is said to be encoding problems, of course, as mentioned above, I set MySQL encoding to GBK, then, I changed the default encoding method of MySQL to UTF-8: first, go to the installation directory of MySQL and set my. open the INI file and modify default-character-set = utf8. Then, use the statement in the database to modify the WP database encoding method: Alter database name Character Set utf8. Finally, restart the MySQL service: net stop MySQL; net start MySQL; no change was found. Finally, I willGo back to wp-config.php and follow the readme.html Installation Wizard to install. PHP prompts "Your PHP seems to lack the MySQL plug-in required for WordPress", which makes it clear that the MySQL component cannot be correctly run when the PHP page is loaded, so something is messy. So I checked the PHP configuration and Apache configuration and finally found that I forgot to specify the PHP module location "phpinidir" D:/PHP ". This sentence is very important, after the installation, restart Apache and run the installation wizard again. There is no problem, but the second problem occurs when the data table is created and the data is written.

An unknown character set: 'utf' error occurred while creating the data table'

The encoding problem persists. The solution is to unify the replica set. There are several places where the encoding is set to UTF-8:

  1. Specifies the character set in MySQL my. ini.
  2. WordPress configuration fileWp-config.php inDefine ('db _ charset', 'utf8 ')
  3. If the adddefacharcharset parameter exists in the Apache configuration file, set it to off or UTF-8.

After the modification is complete, restart the corresponding service and run install. php again.

After successfully installing WP, test 127.0.0.1 to open the WP homepage.

Dynamic domain name, build your own server

I want to use my computer as a Web server for external access, and it is a dialing connection and dynamic IP address of China Telecom. Naturally, I think of a peanut shell. The role and installation of peanut shells are not introduced. There are a lot of Google shells. After applying for and activating my domain name, the domain name test is also passed. You can enter the domain name in the address bar of your browser and press enter to go to my WP page, however, when you click another link, such as a detailed article, you will find that the domain name is still 127.0.0.1. This will not work. This is because the wp url is assigned with the domain name for local test during dynamic table creation and Data Writing, and can be modified in the database. We recommend a GUI-based MySQL management software, MySQL GUI tools, to directly modify and query data. Open the data table wp_options, find the data whose option_name field is siteurl and home, modify the option_value field to your domain name, and save and submit the data. Access the domain name again in the address bar and find that all the content is a hyperlink starting with the domain name. In this way, you can access my WP blog on any computer on the Internet.

Import existing blog posts

I already have some blog posts in csdn and cnblogs. I want to import them to WP and use RSS to import them.

Take cnblogs as an example. select backup on the background control page of cnblogs and save it as a local XML file. This file cannot be imported directly to WP because the format definition is not the same, for details, refer to the format conversion described in the cnblogs blog for WordPress import. Then select RSS import on the WP console, upload the locally processed XML file, and import all articles in cnblogs to WP in a short time, which is very convenient!

Change the theme to install the plug-in

WP is famous for its scalability. There are a large number of plug-ins and themes available on the Internet, and the API interface is well defined. Therefore, you only need to upload the downloaded ZIP file to the topic or plug-in, to complete the installation. Here we recommend a good site for WP resources: http://www.wordpress.la/

By the way, if the code highlight plug-in: auto syntaxhighlighter is installed, do not switch to the HTML mode after the post code, otherwise, the <> and other tag characters in the Code are automatically converted to HTML-encoded. At present, I have not found a solution to this bug, but this problem does not exist as long as the code is directly published after the editing status is pasted and the mode is not switched.

Finally, we wish you a smooth installation!

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.