пї Installing WordPress - Thai wordpress

Installing WordPress

จาก Thai wordpress

ข้ามไปที่: นำทาง, ค้นหา

เนื้อหา


เวิร์ดเพรสนั้นเป็นโปรแกรมที่มีชื่อเสียงว่าติดตั้งได้อย่างง่ายดาย ในเกือบทุกกรณีของการติดตั้งเวิร์ดเพรสจะพบว่า เป็นขั้นตอนที่ง่ายและใช้เวลาเพียงแค่ห้านาทีในการติดตั้งเท่านั้น คู่มือการติดตั้งด้านล่างจะช่วยให้คุณติดตั้งเวิร์ดเพรสได้ง่ายดาย ไม่ว่าคุณจะทำ "การติดตั้งใน 5 นาทีที่โด่งดัง" หรือ คุณจะต้องการการติดตั้งที่มีข้อมูลอย่างละเอียดก็ตาม


สิ่งที่คุณควรต้องรู้ก่อนเริ่มการติดตั้ง

ก่อนที่คุณจะเริ่มทำการติดตั้ง มีบางสิ่งที่คุณต้องมีและจัดการเสียก่อน

สิ่งที่คุณต้องการสำหรับการติดตั้ง

คุณต้องมีสิทธิ์ควบคุมเวบไซต์ของคุณและเข้าถึงไดเรคทอรีของเวบได้ และโปรแกรมที่ใช้ในการติดตั้ง ซึ่งได้แก่:

  • สิทธิ์ในการเข้า web server (ผ่านทางshell or FTP)
  • โปรแกรม text editor
  • โปรแกรม FTP Client (ถ้าคุณต้องการติดตั้งเวิร์ดเพรสบน remote server)
  • เบราเซอร์อะไรก็ได้ที่คุณเลือก

สิ่งที่คุณต้องทำก่อนการติดตั้ง

เริ่มการติดตั้งของคุณโดย:

  1. เช็คให้แน่ใจว่าโฮสท์เวบของคุณนั้นรองรับ ความต้องการพื้นฐานสำหรับการทำงานเวิร์ดเพรส
  2. ดาวน์โหลด เวิร์ดเพรสรุ่นล่าสุดที่นี่
  3. แตกซิบไฟล์ที่ดาวน์โหลดมายังโฟลเดอร์ในฮาร์ดดิสค์ของคุณ
  4. พิมพ์หน้านี้ออกมาเป็นคู่มือสำหรับการติดตั้งของคุณ

การติดตั้งใน 5 นาทีที่โด่งดัง

นี่้เป็นคู่มืออย่างสั้น สำหรับคนที่ต้องการติดตั้งอย่างรวดเร็ว สำหรับคนที่ต้องการข้อมูลที่ละเอียดโปรดดูที่ คู่มือติดตั้งอย่างละเอียด ด้านล่าง

  1. ดาวน์โหลดและแตกซิบไฟล์ติดตั้งเวิร์ดเพรส ถ้าคุณยังไม่มี
  2. สร้างฐานข้อมูลสำหรับเวิร์ดเพรสบนเวบเซิฟเวอร์ของคุณ และสร้างผู้ใช้ MySQL ที่มีสิทธิ์ควบคุมและแก้ไขฐานข้อมูลได้
  3. เปลี่ยนชื่อไฟล์ wp-config-sample.php เป็น wp-config.php
  4. เปิดไฟล์ wp-config.php ในโปรแกรม text editor และ ใส่ข้อมูลเชื่อมต่อกับฐานข้อมูลของคุณ
  5. นำไฟล์เวิร์ดเพรสไปไว้ที่ที่คุณต้องการในเวบเซิฟเวอร์ของคุณ:
    • ถ้าคุณต้องการลงเวิร์ดเพรสในไดเรคทอรีหลักของเวบคุณ (ตัวอย่างเช่น http://example.com/) ให้นำไฟล์ทั้งหมดในโฟลเดอร์ wordpress ที่ถูกแตกซิบแล้ว ไปไว้ในไดเรคทอรีหลักบนเวบเซิฟเวอร์ของคุณ
    • ถ้าคุณต้องการติดตั้งเวิร์ดเพรสในไดเรคทอรีย่อยบนเวบคุณ (ตัวอย่างเช่น http://example.com/blog/) ให้เปลี่ยนชื่อไดเรคทอรี wordpress เป็นชื่อไดเรคทอรีย่อยที่คุณต้องการ และอัพโหลดขึ้นเวบเซิฟเวอร์ของคุณ ตัวอย่างถ้าคุณต้องการติดตั้งเวิร์ดเพรสในไดเรคทอรีย่อยที่มีชื่อว่า "blog" คุณควรจะเปลี่ยนชื่อไดเรคทอรี "wordpress" เป็น "blog" และอัพโหลดขึ้นไปยังไดเรคทอรีหลักของเวบเซิฟเวอร์ของคุณ

      เคล็ดลับ: ถ้าการอัพโหลดไฟล์โดยใช้ FTP ของคุณนั้นช้าเกินไป ให้อ่านการหลีกเลี่ยงการใช้ FTP ที่ : ขั้นตอนที่1: ดาวน์โหลดและแตกซิบ
  6. เริ่มการติดตั้งเวิร์ดเพรสโดยใช้เบราเซอร์ของคุณเข้าไปที่หน้า wp-admin/install.php
    • ถ้าคุณติดตั้งเวิร์ดเพรสในไดเรคทอรีหลัก คุณควรดูที่: http://example.com/wp-admin/install.php
    • ถ้าคุณติดตั้งเวิร์ดเพรสในไดเรคทอรีย่อย สมมุติว่าชื่อ blog คุณควรดูที่: http://example.com/blog/wp-admin/install.php

เพียงเท่านี้ เวิร์ดเพรสก็ติดตั้งเสร็จเรียบร้อยแล้ว

หรือดูตัวอย่างการติดตั้งได้ที่:

คู่มือติดตั้งอย่างละเอียด

ขั้นตอนที่1: ดาวน์โหลดและแตกซิบ

ดาวน์โหลดและแตกซิบไฟล์ติดตั้งเวิร์ดเพรสจาก http://wordpress.org/download/

  • ถ้าคุณจะอัพโหลดเวิร์ดเพรสขึ้นไปยังเวบเซิฟเวอร์ คุณต้องใช้เบราเซอร์ดาวน์โหลดไฟล์ซิบเวิร์ดเพรสมายังเครื่องของคุณและแตกไฟล์ซิบ
  • ถ้าคุณมีสิทธิ์ shell เข้าถึงเวบเซิฟเวอร์ของคุณ และคุ้นเคยกับการใช้งานมัน คุณอาจจะดาวน์โหลดเวิร์ดเพรสโดยตรงไปยัง เวบเซิฟเวอร์ ของคุณโดยใช้คำสั่ง wget (หรือ lynx หรือใช้วิธีอื่น ๆ) ถ้าคุณไม่ต้องการใช้ FTP:
    • wget http://wordpress.org/latest.tar.gz
    • แล้วแตกซิบไฟล์โดยใช้คำสั่ง:
      tar -xzvf latest.tar.gz

      ไฟล์ซิบเวิร์ดเพรสจะถูกแตกซิบออกมาอยู่ในโฟลเดอร์ที่ชื่อว่า wordpress ในไดเรคทอรีเดียวกับไฟล์ latest.tar.gz ที่คุณดาวน์โหลดมา
  • ถ้าคุณ "ไม่มี" สิทธิ์ shell เข้าเวบเซิฟเวอร์ของคุณ หรือคุณไม่คุ้นเคยกับการใช้งานมัน คุณอาจจะ deploy ไฟล์เวิร์ดเพรสโดยตรงไปที่ เวบเซิฟเวอร์ ของคุณ โดยใช้ ZipDeploy.

ขั้นตอนที่ 2: การสร้างฐานข้อมูลและผู้ใช้

ถ้าคุณใช้โฮสท์จาก ผู้ให้บริการโฮสท์ คุณอาจจะมีฐานข้อมูลเวิร์ดเพรสที่ตั้งค่าสำหรับคุณให้แล้ว หรืออาจจะมีการติดตั้งแบบอัตโนมัติให้ ลองตรวจดูที่หน้า support ของผู้ให้บริการโฮสท์ของคุณ หรือที่หน้า control panel ของคุณ เพื่อให้รู้ว่าคุณสามารถลงแบบอัตโนมัติได้หรือว่าคุณต้องติดตั้งเวิร์ดเพรสด้วยตัวเอง

ถ้าคุณตัดสินใจว่าคุณต้องการที่จะติดตั้งเวิร์ดเพรสด้วยตัวเอง กรุณาทำตามคู่มือนี้

accessing phpMyAdmin on various servers หรือทำตามคู่มือนี้ Using cPanel หรือ Using phpMyAdmin ที่ด้านล่าง

ถ้าคุณกำลังติดตั้งเวิร์ดเพรสบนเวบเซอร์เวอร์ของคุณเอง จงทำตามคู่มือ Using phpMyAdmin หรือ Using the MySQL Client ด้านล่าง เพื่อสร้างผู้ใช้และรหัสผ่านเวิร์ดเพรสของคุณ

ถ้าคุณมีฐานข้อมูลเพียงอันเดียวและถูกใช้งานอยู่ คุณสามารถติดตั้งเวิร์ดเพรสได้ ขอเพียงมั่นใจว่าคำนำหน้าตารางในฐานข้อมูลของคุณไม่ซ้ำกับโปรแกรมที่ใช้ฐานข้อมูลนี้อยู่ เพื่อหลีกเลี่ยงการเขียนข้อมูลทับกันในฐานข้อมูล

การใช้งาน cPanel

บทความหลัก: Using cPanel

ถ้าผู้ให้บริการโฮสท์ของคุณใช้ cPanel คุณอาจจะทำตามคู่มือเหล่านี้เพื่อสร้างผู้ใช้และฐานข้อมูลเวิร์ดเพรสของคุณ

  1. เข้าสู่ระบบ cPanel ของคุณ
  2. กดที่ MySQL Databases
  3. ถ้าผู้ใช้ที่จะใช้งานเวิร์ดเพรสนั้นยังไม่มีในส่วน Users ให้คุณทำการสร้างขึ้นมา:
    1. เลือกชื่อผู้ใช้ (username) สำหรับเวิร์ดเพรส ('wordpress' ก็เป็นชื่อที่ใช้ได้) ใช่ชื่อนี้เข้าไปในช่อง UserName
    2. เลือกรหัสผ่านให้ยากแก่การเดาออก (ปกติควรจะใช้ตัวอักษรใหญ่ เล็ก ตัวเลขและสัญลักษณ์ผสมกัน) และใส่ลงในช่อง Password
    3. จด username และ password ที่คุณเลือกไว้ (ผู้ใช้และรหัสผ่าน)
    4. กดที่ Add User.
  4. ถ้าฐานข้อมูลที่คุณต้องการใช้สร้างเวิร์ดเพรสยังไม่มีอยู่ในส่วน Databases ให้คุณทำการสร้างขึ้นมา:
    1. เลือกชื่อฐานมูล (database) สำหรับเวิร์ดเพรส ('wordpress' หรือ 'blog' ก็เป็นชื่อที่ใช้ได้) ใช่ชื่อนี้เข้าไปในช่อง Db และกด Add Db.
  5. ภายใต้ Databases เลือก username ที่คุณจะใช้จาก User dropdown แล้วเลือก database เวิร์ดเพรสจาก Db dropdown โปรดมั่นใจว่าช่อง All ได้ถูกติ๊กภายใต้ส่วน Privileges (การให้สิทธิ์ต่าง ๆ) แล้วกด Add User to Db.
  6. เมื่อคุณกลับมายังหน้าจอ MySQL Account Maintenance' screen, cPanel will list information about the database you just created. You should see the username you just added to the database (with ALL PRIVILEGES), as well as a few sample Connection Strings for you to use in Perl or PHP scripts to connect to the database. The PHP code will have the following format:
$dbh = mysql_connect("hostname", "username", "<PASSWORD HERE>") or die ("message");
mysql_select_db("databasename");
Write down the values of hostname, username, databasename, and the password you chose. (Note that hostname will usually be localhost.)

Using phpMyAdmin

If your web server has phpMyAdmin installed, you may follow these instructions to create your WordPress username and database.

Note: These instructions are written for phpMyAdmin 2.6.0; the phpMyAdmin user interface can vary slightly between versions.

  1. If a database relating to WordPress does not already exist in the Database dropdown on the left, create one:
    1. Choose a name for your WordPress database ('wordpress' or 'blog' are good), enter it in the Create new database field, and click Create.
  2. Click the Home icon in the upper left to return to the main page, then click Privileges. If a user relating to WordPress does not already exist in the list of users, create one:
    1. Click Add a new User.
    2. Chose a username for WordPress ('wordpress' is good) and enter it in the User name field. (Be sure Use text field: is selected from the dropdown.)
    3. Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field. (Be sure Use text field: is selected from the dropdown.) Re-enter the password in the Re-type field.
    4. Write down the username and password you chose.
    5. Leave all options under Global privileges at their defaults.
    6. Click Go.
  3. Return to the Privileges screen and click the Check privileges icon on the user you've just created for WordPress. In the Database-specific privileges section, select the database you've just created for WordPress under the Add privileges to the following database dropdown. The page will refresh with privileges for that database. Click Check All to select all privileges, and click Go.
  4. On the resulting page, make note of the host name listed after Server: at the top of the page. (This will usually be localhost.)

Using the MySQL Client

If you have shell access to your web server, are comfortable with using the command line, and your MySQL user has the permissions to create MySQL users and databases, you may follow the example session below to create your WordPress username and database.

$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)
 
mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
    -> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
  
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye
$ 

In the above:

  • adminusername will typically be root, unless you have another high-privileged account set up.
  • wordpress or blog are good values for databasename.
  • wordpress is a good value for wordpressusername.
  • hostname will usually be localhost. If you don't know what this value should be, check with your system administrator. If you are the system administrator, figure out what this value should be.
  • password should be a difficult-to-guess password, ideally containing a combination of upper- and lower-case letters, numbers, and symbols.

Write down the values you used for databasename, wordpressusername, hostname, and password.

การใช้งาน Plesk

ดูที่: การใช้งาน Plesk 7 ในเวบ tamba2.org

Step 3: Set up wp-config.php

For the next part, the code you will be looking to change is as follows:

// ** MySQL settings ** //
define('DB_NAME', 'putyourdbnamehere');    // The name of the database
define('DB_USER', 'usernamehere');     // Your MySQL username
define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
// Change SECRET_KEY to a unique phrase.  You won't have to remember it later,
// so make it long and complicated.  You can visit https://www.grc.com/passwords.htm
// to get a phrase generated for you, or just make something up.
define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 
  1. Returning to where you extracted the WordPress package in Step 1, rename the file wp-config-sample.php to wp-config.php.
  2. Open the renamed wp-config.php file in your favorite text editor and fill in the following information, per the example above:
    DB_NAME 
    The name of the database you created for WordPress in Step 2 .
    DB_USER 
    The username you created for WordPress in Step 2.
    DB_PASSWORD 
    The password you chose for the WordPress username in Step 2.
    DB_HOST 
    The hostname you determined in Step 2 (usually localhost, but not always. See some possible DB_HOST values).
    DB_CHARSET 
    The database character set, normally should not be changed. See Editing wp-config.php for details.
    DB_COLLATE 
    The database collation should normally be left blank. See Editing wp-config.php for details.
  3. Save the file.
  • For more extensive details, and step by step instructions for creating the configuration file, refer to Editing wp-config.php.

For information on enabling SSL in WordPress 2.6, see SSL and Cookies in WordPress 2.6.

Step 4: Upload the files

Now you will need to decide where on your web site you'd like your blog to appear:

  • In the root directory of your web site. (For example, http://example.com/)
  • In a subdirectory of your web site. (For example, http://example.com/blog/)

Note: The location of your root web directory in the filesystem on your web server will vary across hosting providers and operating systems. Check with your hosting provider or system administrator if you do not know where this is.

In the Root Directory

  • If you need to upload your files to your web server, use your favorite FTP client to upload all the contents of the wordpress directory (but not the directory itself) into the root directory of your web site.
  • If your files are already on your web server, and you are using shell access to install WordPress, move all of the contents of the wordpress directory (but not the directory itself) into the root directory of your web site.

In a Subdirectory

  • If you need to upload your files to your web server, rename the wordpress directory to your desired name, then use your favorite FTP client to upload the directory to your desired location within the root directory of your web site.
  • If your files are already on your web server, and you are using shell access to install WordPress, move the wordpress directory to your desired location within the root directory of your web site, and rename the directory to your desired name.

Step 5: Run the Install Script

Point your favorite web browser to start the installation script.

  • If you placed the WordPress files in the root directory, you should visit: http://example.com/wp-admin/install.php
  • If you placed the WordPress files in a subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

The following screenshots show how the installation progresses. Notice in the screen, Entering the details, you enter your Weblog title and your e-mail address. Also displayed is a check-box asking if you would like your blog to appear in search engines like Google and Technorati. Leave the box checked if you would like your blog to be visible to everyone, including search engines, and uncheck the box if you want to block search engines, but allow normal visitors. Note all this information can be changed later in your Administration Panels.

Version 2.3

ภาพ:Install23-step0.png
WordPress Version 2.3, Entering details
ภาพ:Install23-step1.png
WordPress Version 2.3, All done!

Install Script Troubleshooting

  • If you get an error about the database when you run the install script:
    • Go back to Step 2 and Step 3, and be sure you got all the correct database information and that it was entered correctly into wp-config.php.
    • Be sure you granted your WordPress user permission to access your WordPress database in Step 3.
    • Be sure the database server is running.

ปัญหาพื้นฐานในการติดตั้ง

The following are some of the most common installation problems. For more information and troubleshooting for problems with your WordPress installation, check out FAQ Installation and FAQ Troubleshooting.

I see lots of Headers already sent errors. How do I fix this? 
You probably introduced a syntax error in editing wp-config.php.
  1. Download wp-config.php (if you don't have shell access).
  2. Open it in your favorite text editor.
  3. Check that the first line contains nothing but <?php, and that there is no text before it (not even whitespace).
  4. Check that the last line contains nothing but ?>, and that there is no text after it (not even whitespace).
  5. If your text editor saves as Unicode, make sure it adds no byte order mark (BOM). Most Unicode-enabled text editors do not inform the user whether it adds a BOM to files; if so, try using a different text editor.
  6. Save the file, upload it again if necessary, and reload the page in your browser.
My page comes out gibberish. When I look at the source I see a lot of "<?php ?>" tags. 
If the <?php ?> tags are being sent to the browser, it means your PHP is not working properly. All PHP code is supposed to be executed before the server sends the resulting HTML to your web browser. (That's why it's called a preprocessor.) Make sure your web server meets the requirements to run WordPress, that PHP is installed and configured properly, or contact your hosting provider or system administrator for assistance.
I keep getting an Error connecting to database message but I'm sure my configuration is correct. 
Try resetting your MySQL password manually. If you have access to MySQL via shell, try issuing:
SET PASSWORD FOR 'wordpressusername'@'hostname' = OLD_PASSWORD('password');
If you are using a version of MySQL prior to 4.1, use PASSWORD instead of OLD_PASSWORD. If you do not have shell access, you should be able to simply enter the above into an SQL query in phpMyAdmin. Failing that, you may need to use your host's control panel to reset the password for your database user.
My image/MP3 uploads aren't working. 
If you use the Rich Text Editor on a blog that's installed in a subdirectory, and drag a newly uploaded image into the editor field, the image may vanish a couple seconds later. This is due to a problem with TinyMCE (the rich text editor) not getting enough information during the drag operation to construct the path to the image or other file correctly. The solution is to NOT drag uploaded images into the editor. Instead, click and hold on the image and select "Send to Editor."

ติดตั้งบล็อกหลาย ๆ บล็อก

ดูรายละเอียดการ Installing Multiple Blogs

ติดตั้งเวิร์ดเพรสในเครื่องของคุณ

If you have a sufficiently powerful home computer and a sufficiently fast broadband connection, you may want to avoid certain hosting charges by using your own computer as a server. The following tutorials will show you how to setup a server environment and install WordPress on your home computer.

รับข้อมูลจาก "http://codex.wordthai.com/Installing_WordPress"
เครื่องมือส่วนตัว