I bought a virtual host on dreamhost. In the past two days, I have built a blog system, a multi-user version.
Record the difficulties and solutions you encounter during the setup process for future reference.
I did not hesitate to select WordPress. It should be the most popular blog system currently.
Dreamhost does not support wildcard domain name resolution, so I didn't use the sub-domain method (I was dizzy, tried several times, and checked some information to know it was not supported ), sub-directory is used.
At first, the PHP version I selected was 4.x. there was no problem with the installation, but after the installation, the URL always had a sub-path named CGI-system, which was very annoying, this is totally incorrect. Many people have encountered this problem by checking the information. Someone on the Internet suggested modifying the code, and someone suggested using PHP 5.x. How can we make it easier? I just need to use PHP 5.x.
Well, the installation is smooth, and registration and logon are also smooth.
However, Chinese characters cannot be saved. Once a Chinese character is input, "?" is displayed. My God, I want so many "?" Why? Querying data is a character set problem. Run the following three commands,
Set names utf8;
Set Character Set utf8;
Set collation_connection = 'utf8 _ general_ci ';
Still not good.
I am querying the SQL statements created by the table. I am ft, and the default character set is Latin1. Haha, even overlord is hard on the bow and the SQL statement is first exported, change the default Character Set of the statement for table creation to utf8 and re-import it to the database!
I will check the information later. It turns out there is no need to be so troublesome. You can modify it as follows:
- Modify WP-DES/wp-db.php
- $ This-> DBH = @ mysql_connect ($ dbhost, $ dbuser, $ dbpassword );
- // Add the following line after the preceding statement
- $ This-> query ("set names 'utf8 '");
You can also modify the character set and connection method in the wp-config.php under the root directory as follows:
Define ('db _ charset', 'utf8 ');
Define ('db _ collate', 'utf8 ');
Well, the Chinese Question is okay.
In addition, it is not feasible to switch a blog system from one host to another. Even if you only change the PHP file system path and do not change the database, it does not seem to work. I have never studied PHP code carefully. I am afraid to speculate on it. I will comment on it later if I am interested in the source code.
Wordpress.org.cn has a detailed discussion about the Chinese version of WordPress. Even the zh_cn.mo does not work. Well, I have no energy to study it in detail. It is almost the same.
Theme is ugly for several theme that comes with WordPress. I found one on the Internet. It looks pretty, but unfortunately it is in English. If you have installed a Chinese Language Pack, you do not need to change it to Chinese. In addition, some modifications were made. It seems okay in IE, but it is still a little ugly in Firefox. Click here to view my blog. Because it is a multi-user version, you can also apply for blogfrom http://blog.zijinshi.cn/index.php.
The original author of theme is jam. I would like to express my gratitude here. Similarly, I shared my modified theme. Download
In the future, this problem occurs again: When the default language is Chinese, the user registers the blog with the following prompt:
Warning: invalid argument supplied for foreach () in/home/user/WP-nodes des/capabilities. php on line 31
In addition, the user cannot log on to manage the newly registered blog, open the newly registered blog, and find that the blog cannot display Chinese characters. The reason is that the default Character Set of the database is not utf8 (only the table is changed to utf8, but if the database is not, the new table will not be created in the future ). You can modify the database attributes in phpadmin, or use SQL statements.
Alter database 'databasename' default Character Set utf8 collate utf8_general_ci;
Well, the problem is solved.
(End)