際際滷

際際滷Share a Scribd company logo
T━m hi?u c?u tr┣c v┐ c?u h━nh n?ng
cao c?a WP
Gi│o tr━nh: L?p tr━nh Wordpress chuy┷n nghi?p
Bi┷n so?n: ZendVN Group
Website: www.zend.vn
C?u tr┣c th? m?c v┐ c│c t?p tin
? C┏ 3 th? m?c ch┴nh:
C /wp-admin
C /wp-content
C /wp-includes
C?u h━nh WordPress
? C┏ 2 t?p tin trong th? m?c g?c gi┣p ch┣ng ta thi?t
l?p c│c gi│ tr? c?u h━nh cho WP ?┏ l┐ t?p tin:
C wp-config.php
C .htaccess
C?u h━nh trong wp-config.php
1. Thay ??i th? m?c ch?a t?p tin wp-config.php
o D:xampp1.7htdocswpprowp-config.php
o D:xampp1.7htdocswp-config.php
2. Thi?t l?p ti?n t? cho c│c b?ng trong database WP
o $table_prefix = 'wp_';
C?u h━nh trong wp-config.php
3. Thay ??i URL ch?y ch┴nh c?a WP
o define( 'WP_SITEURL', 'http://example.com/wordpress' );
o define( 'WP_HOME', 'http://example.com/wordpress' );
4. Thay ??i ???ng d?n ??n th? m?c ch?a Plugin
o define( 'WP_PLUGIN_DIR', 'New Path');
o define( 'WP_PLUGIN_URL', 'New URL');
C?u h━nh trong wp-config.php
5. Thay ??i gi│ tr? c?a WP_POST_REVISIONS
o define( 'WP_POST_REVISIONS', false );
o define( 'WP_POST_REVISIONS', 5 );
6. Thay ??i gi│ tr? th?i gian cho AUTOSAVE_INTERVAL
o define( 'AUTOSAVE_INTERVAL', 150 );
C?u h━nh trong wp-config.php
7. Hi?n th? c│c c?u truy v?n tr┷n m?t trang c?a WP
o define( 'SAVEQUERIES', true );
Hi?n th? chi ti?t c│c c?u truy v?n tr┷n trang
o global $wpdb;
o print_r( $wpdb->queries );
C?u h━nh trong wp-config.php
8. T?ng b? nh? cho ?ng d?ng WP
- Allowed memory size of xxxxx bytes exhausted
o define( 'WP_MEMORY_LIMIT', '128M' );
C?u h━nh trong wp-config.php
9. Thi?t l?p ng?n ng? v┐ ??nh d?ng qu?c t?
o define ( 'WPLANG', 'en-GB' );
10. Thi?t l?p th? m?c ch?a c│c t?p tin ng?n ng?
o Default: define( 'LANGDIR', '/wp-content/languages' );
o Custom: define( 'LANGDIR', '/wp-content/my/languages' );
C?u h━nh trong wp-config.php
11. Chia s? d? li?u ng??i d┫ng (Multisite)
o define( 'CUSTOM_USER_TABLE', 'share_users' );
o define( 'CUSTOM_USER_META_TABLE', 'share_usermeta' );
12. Thi?t l?p COOKIE cho nhi?u domain (Multisite)
o define( 'COOKIE_DOMAIN', '.domain.com' );
o define( 'COOKIEPATH', '/' );
o define( 'SITECOOKIEPATH', '/' );
C?u h━nh trong wp-config.php
13. Thi?t l?p t┐i kho?n FTP cho website
o define( 'FTP_USER', 'username' );
o define( 'FTP_PASS', 'password' );
o define( 'FTP_HOST', 'ftp.example.com:21' );
C?u h━nh trong wp-config.php
14. C?u h━nh th? m?c FTP v┐ SSH
o define( 'FS_METHOD', 'ftpext' );
o define( 'FTP_BASE', '/public_html/wordpress/' );
o define( 'FTP_CONTENT_DIR', '/public_html/wordpress/wp-
content/' );
o define( 'FTP_PLUGIN_DIR ', '/ public_html /wordpress/wp-
content/plugins/' );
o define( 'FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub' );
o define( 'FTP_PRIVKEY', '/home/username/.ssh/id_rsa' );
o define( 'FTP_SSL', false );
C?u h━nh trong wp-config.php
15. Thi?t l?p c?p ph└p cho th? m?c
o define( 'FS_CHMOD_FILE',0644 );
o define( 'FS_CHMOD_DIR',0755 );
16. Thi?t l?p Cache n?ng cao
o define( 'WP_CACHE', true );
o wp-content/advanced-cache.php
C?u h━nh trong wp-config.php
17. Thi?t l?p ch? ?? login
o define( 'FORCE_SSL_LOGIN', true );
o define( 'FORCE_SSL_ADMIN', true );
18. Thi?t l?p th?i gian x┏a TRASH
o define( 'EMPTY_TRASH_DAYS', 7 );
C?u h━nh trong wp-config.php
19. Thi?t l?p ch? ?? Cron
o define( 'DISABLE_WP_CRON', true );
20. Thi?t l?p gi│ tr? kh?ng ch?nh s?a trong Admin
o define('DISALLOW_FILE_EDIT', TRUE);
C?u h━nh t?p tin .htaccess

More Related Content

H?c l?p tr━nh Wordpress - b┐i 2 - T━m hi?u c?u tr┣c v┐ c?u h━nh n?ng cao

  • 1. T━m hi?u c?u tr┣c v┐ c?u h━nh n?ng cao c?a WP Gi│o tr━nh: L?p tr━nh Wordpress chuy┷n nghi?p Bi┷n so?n: ZendVN Group Website: www.zend.vn
  • 2. C?u tr┣c th? m?c v┐ c│c t?p tin ? C┏ 3 th? m?c ch┴nh: C /wp-admin C /wp-content C /wp-includes
  • 3. C?u h━nh WordPress ? C┏ 2 t?p tin trong th? m?c g?c gi┣p ch┣ng ta thi?t l?p c│c gi│ tr? c?u h━nh cho WP ?┏ l┐ t?p tin: C wp-config.php C .htaccess
  • 4. C?u h━nh trong wp-config.php 1. Thay ??i th? m?c ch?a t?p tin wp-config.php o D:xampp1.7htdocswpprowp-config.php o D:xampp1.7htdocswp-config.php 2. Thi?t l?p ti?n t? cho c│c b?ng trong database WP o $table_prefix = 'wp_';
  • 5. C?u h━nh trong wp-config.php 3. Thay ??i URL ch?y ch┴nh c?a WP o define( 'WP_SITEURL', 'http://example.com/wordpress' ); o define( 'WP_HOME', 'http://example.com/wordpress' ); 4. Thay ??i ???ng d?n ??n th? m?c ch?a Plugin o define( 'WP_PLUGIN_DIR', 'New Path'); o define( 'WP_PLUGIN_URL', 'New URL');
  • 6. C?u h━nh trong wp-config.php 5. Thay ??i gi│ tr? c?a WP_POST_REVISIONS o define( 'WP_POST_REVISIONS', false ); o define( 'WP_POST_REVISIONS', 5 ); 6. Thay ??i gi│ tr? th?i gian cho AUTOSAVE_INTERVAL o define( 'AUTOSAVE_INTERVAL', 150 );
  • 7. C?u h━nh trong wp-config.php 7. Hi?n th? c│c c?u truy v?n tr┷n m?t trang c?a WP o define( 'SAVEQUERIES', true ); Hi?n th? chi ti?t c│c c?u truy v?n tr┷n trang o global $wpdb; o print_r( $wpdb->queries );
  • 8. C?u h━nh trong wp-config.php 8. T?ng b? nh? cho ?ng d?ng WP - Allowed memory size of xxxxx bytes exhausted o define( 'WP_MEMORY_LIMIT', '128M' );
  • 9. C?u h━nh trong wp-config.php 9. Thi?t l?p ng?n ng? v┐ ??nh d?ng qu?c t? o define ( 'WPLANG', 'en-GB' ); 10. Thi?t l?p th? m?c ch?a c│c t?p tin ng?n ng? o Default: define( 'LANGDIR', '/wp-content/languages' ); o Custom: define( 'LANGDIR', '/wp-content/my/languages' );
  • 10. C?u h━nh trong wp-config.php 11. Chia s? d? li?u ng??i d┫ng (Multisite) o define( 'CUSTOM_USER_TABLE', 'share_users' ); o define( 'CUSTOM_USER_META_TABLE', 'share_usermeta' ); 12. Thi?t l?p COOKIE cho nhi?u domain (Multisite) o define( 'COOKIE_DOMAIN', '.domain.com' ); o define( 'COOKIEPATH', '/' ); o define( 'SITECOOKIEPATH', '/' );
  • 11. C?u h━nh trong wp-config.php 13. Thi?t l?p t┐i kho?n FTP cho website o define( 'FTP_USER', 'username' ); o define( 'FTP_PASS', 'password' ); o define( 'FTP_HOST', 'ftp.example.com:21' );
  • 12. C?u h━nh trong wp-config.php 14. C?u h━nh th? m?c FTP v┐ SSH o define( 'FS_METHOD', 'ftpext' ); o define( 'FTP_BASE', '/public_html/wordpress/' ); o define( 'FTP_CONTENT_DIR', '/public_html/wordpress/wp- content/' ); o define( 'FTP_PLUGIN_DIR ', '/ public_html /wordpress/wp- content/plugins/' ); o define( 'FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub' ); o define( 'FTP_PRIVKEY', '/home/username/.ssh/id_rsa' ); o define( 'FTP_SSL', false );
  • 13. C?u h━nh trong wp-config.php 15. Thi?t l?p c?p ph└p cho th? m?c o define( 'FS_CHMOD_FILE',0644 ); o define( 'FS_CHMOD_DIR',0755 ); 16. Thi?t l?p Cache n?ng cao o define( 'WP_CACHE', true ); o wp-content/advanced-cache.php
  • 14. C?u h━nh trong wp-config.php 17. Thi?t l?p ch? ?? login o define( 'FORCE_SSL_LOGIN', true ); o define( 'FORCE_SSL_ADMIN', true ); 18. Thi?t l?p th?i gian x┏a TRASH o define( 'EMPTY_TRASH_DAYS', 7 );
  • 15. C?u h━nh trong wp-config.php 19. Thi?t l?p ch? ?? Cron o define( 'DISABLE_WP_CRON', true ); 20. Thi?t l?p gi│ tr? kh?ng ch?nh s?a trong Admin o define('DISALLOW_FILE_EDIT', TRUE);
  • 16. C?u h━nh t?p tin .htaccess