{"id":4589,"date":"2025-07-15T01:17:05","date_gmt":"2025-07-14T16:17:05","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=4589"},"modified":"2026-06-06T09:17:59","modified_gmt":"2026-06-06T00:17:59","slug":"zhx9ag1du21niaw","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2025\/07\/15\/zhx9ag1du21niaw\/","title":{"rendered":"VPS \u4e0a\u4f7f\u7528 Duplicator \u8fc1\u79fb WordPress \u53ca MariaDB \u5e38\u89c1 Collation \u95ee\u9898\u89e3\u6790"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728\u4e00\u53f0 VPS \u4e0a\u5b8c\u6210\u4e86 WordPress \u7684\u8fc1\u79fb\u4e0e\u91cd\u5efa\uff0c\u4f7f\u7528 Duplicator \u63d2\u4ef6\u5bfc\u51fa\u5b8c\u6574\u5b89\u88c5\u5305\uff0c\u7ed3\u5408 Apache\u3001MariaDB \u53ca Certbot SSL \u914d\u7f6e\uff0c\u6574\u7406\u4e86\u5b8c\u6574\u7684\u5b89\u88c5\u6b65\u9aa4\u4e0e\u9047\u5230\u7684\u5e38\u89c1\u9519\u8bef\u53ca\u89e3\u51b3\u65b9\u6848\uff0c\u4f9b\u53c2\u8003\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u57fa\u7840\u73af\u5883\u51c6\u5907<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u670d\u52a1\u5668\u73af\u5883\u57fa\u4e8e Ubuntu\u3002\u9700\u8981\u5b89\u88c5\u4ee5\u4e0b\u8f6f\u4ef6\u5305\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<br>sudo apt upgrade -y<br>sudo apt install apache2 mariadb-server php php-mysql libapache2-mod-php php-zip unzip -y<br>sudo systemctl enable apache2 mariadb<br>sudo systemctl start apache2 mariadb<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 MariaDB \u914d\u7f6e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MariaDB \u9ed8\u8ba4\u4f7f\u7528 unix_socket \u63d2\u4ef6\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u8fdb\u884c\u5916\u90e8\u8fde\u63a5\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b SQL \u4fee\u6539 root \u7528\u6237\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('\u81ea\u5b9a\u4e49\u5bc6\u7801');<br>FLUSH PRIVILEGES;<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u968f\u540e\uff0c\u521b\u5efa WordPress \u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;<br>EXIT;<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Apache \u865a\u62df\u4e3b\u673a\u914d\u7f6e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/apache2\/sites-available\/example.com.conf<\/code>\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;VirtualHost *:80&gt;<br>    ServerName example.com<br>    ServerAlias www.example.com<br>    DocumentRoot \/var\/www\/example.com<br><br>    &lt;Directory \/var\/www\/example.com&gt;<br>        AllowOverride All<br>        Require all granted<br>    &lt;\/Directory&gt;<br><br>    ErrorLog ${APACHE_LOG_DIR}\/example_error.log<br>    CustomLog ${APACHE_LOG_DIR}\/example_access.log combined<br>&lt;\/VirtualHost&gt;<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u542f\u7528\u7ad9\u70b9\u53ca URL \u91cd\u5199\u529f\u80fd\uff0c\u5e76\u91cd\u8f7d Apache\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo a2ensite example.com.conf<br>sudo a2enmod rewrite<br>sudo systemctl reload apache2<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u4e0a\u4f20\u5e76\u89e3\u538b Duplicator \u5305<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c06 <code>installer.php<\/code> \u548c\u6253\u5305\u597d\u7684 <code>.zip<\/code> \u6587\u4ef6\u4e0a\u4f20\u81f3 <code>\/var\/www\/example.com\/<\/code> \u76ee\u5f55\u3002<br>\u5982\u679c\u6d4f\u89c8\u5668\u8bbf\u95ee\u5b89\u88c5\u5668\u65f6\u76f4\u63a5\u663e\u793a PHP \u6e90\u7801\uff0c\u9700\u5b89\u88c5\u5e76\u542f\u7528 PHP \u6a21\u5757\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install php libapache2-mod-php php-mysql php-zip -y<br>sudo systemctl restart apache2<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u89e3\u51b3 ZipArchive \u9519\u8bef<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u51fa\u73b0 <code>ZipArchive is not enabled on this server...<\/code> \u62a5\u9519\u65f6\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install php-zip -y<br>sudo systemctl restart apache2<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u4ecd\u65e0\u6cd5\u81ea\u52a8\u89e3\u538b\uff0c\u53ef\u5148\u624b\u52a8\u89e3\u538b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cd \/var\/www\/example.com<br>unzip package_archive.zip<br>rm wp-content\/object-cache.php<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u5728\u5b89\u88c5\u754c\u9762\u9009\u62e9\u300cAdvanced \u2192 Manual Extract\u300d\u7ee7\u7eed\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Redis \u7f13\u5b58\u9519\u8bef\u89e3\u51b3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u63d0\u793a <code>Error establishing a Redis connection<\/code>\uff0c\u53ef\u5220\u9664 <code>wp-content<\/code> \u76ee\u5f55\u4e2d\u7684\u7f13\u5b58\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rm \/var\/www\/example.com\/wp-content\/object-cache.php<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u914d\u7f6e SSL\uff08Certbot\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u914d\u7f6e HTTPS \u8bc1\u4e66\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install certbot python3-certbot-apache -y<br>sudo certbot --apache -d example.com -d www.example.com<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 MariaDB \u6570\u636e\u5e93\u8fde\u63a5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Duplicator \u5b89\u88c5\u5668\u754c\u9762\u586b\u5199\u6570\u636e\u5e93\u8fde\u63a5\u4fe1\u606f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Host: <code>localhost<\/code><\/li>\n\n\n\n<li>Database: <code>wordpress<\/code><\/li>\n\n\n\n<li>User: <code>root<\/code><\/li>\n\n\n\n<li>Password: \u8bbe\u7f6e\u7684\u81ea\u5b9a\u4e49\u5bc6\u7801<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u63d2\u4ef6\u72b6\u6001\u4e0e wp-cli \u64cd\u4f5c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u90e8\u5206\u63d2\u4ef6\uff08\u5982 Jetpack\uff09\u8fc1\u79fb\u540e\u4f1a\u88ab\u81ea\u52a8\u7981\u7528\uff0c\u53ef\u767b\u5f55\u540e\u53f0\u91cd\u65b0\u542f\u7528\uff0c\u6216\u8005\u4f7f\u7528 wp-cli \u64cd\u4f5c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wp plugin list<br>wp plugin activate jetpack<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u672a\u5b89\u88c5 wp-cli\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5feb\u901f\u5b89\u88c5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -O https:\/\/raw.githubusercontent.com\/wp-cli\/builds\/gh-pages\/phar\/wp-cli.phar<br>php wp-cli.phar --info<br>chmod +x wp-cli.phar<br>sudo mv wp-cli.phar \/usr\/local\/bin\/wp<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u6570\u636e\u5e93 Collation \u517c\u5bb9\u6027\u63d0\u793a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fc1\u79fb\u8fc7\u7a0b\u4e2d\uff0c\u5982\u51fa\u73b0\u4ee5\u4e0b\u63d0\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>collation isn't supported on current database. \"Legacy Collation\" will be replaced with default values.<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u56e0\u4e3a\u6e90\u670d\u52a1\u5668\u4f7f\u7528\u4e86\u8f83\u65b0\u7248\u672c MySQL\uff08\u5982 MySQL 8.0\uff09\u4e2d\u7684\u6392\u5e8f\u89c4\u5219\uff08\u5982 <code>utf8mb4_0900_ai_ci<\/code> \u6216 <code>utf8mb4_unicode_520_ci<\/code>\uff09\uff0c\u800c\u5f53\u524d VPS \u4e0a\u7684 MariaDB \u5e76\u4e0d\u652f\u6301\u3002\u6b64\u65f6\u4f1a\u81ea\u52a8\u66ff\u6362\u4e3a <code>utf8mb4_general_ci<\/code>\uff0c\u901a\u5e38\u4e0d\u5f71\u54cd\u6b63\u5e38\u8fd0\u884c\uff0c\u53ef\u76f4\u63a5\u7ee7\u7eed\u5b89\u88c5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u5e0c\u671b\u4e25\u683c\u4fdd\u7559\u539f\u6709 collation\uff0c\u53ef\u9009\u62e9\u5347\u7ea7\u6570\u636e\u5e93\u5230 MySQL 8.0+\uff0c\u6216\u8005\u5728\u5907\u4efd\u524d\u5c06\u6240\u6709\u8868\u8f6c\u6362\u4e3a\u901a\u7528 collation\uff08\u5982 <code>utf8mb4_unicode_ci<\/code>\uff09\u3002\u4f46\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u65e0\u9700\u7279\u522b\u4fee\u6539\u5373\u53ef\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u8fc1\u79fb\u540e\u5b89\u5168\u6e05\u7406<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5220\u9664 Duplicator \u5b89\u88c5\u6587\u4ef6<\/li>\n\n\n\n<li>\u786e\u8ba4\u81ea\u52a8\u91cd\u5b9a\u5411\u5230 HTTPS \u662f\u5426\u751f\u6548<\/li>\n\n\n\n<li>\u68c0\u67e5\u524d\u53f0\u4e0e\u540e\u53f0\u8bbf\u95ee\u662f\u5426\u6b63\u5e38<\/li>\n\n\n\n<li>\u6838\u67e5\u6570\u636e\u5e93\u4e0e\u63d2\u4ef6\u529f\u80fd<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udcac \u603b\u7ed3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fc1\u79fb WordPress \u8fc7\u7a0b\u4e2d\uff0c\u4e3b\u8981\u9047\u5230\u4ee5\u4e0b\u5e38\u89c1\u95ee\u9898\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP \u672a\u542f\u7528\u5bfc\u81f4\u5b89\u88c5\u5668\u76f4\u63a5\u663e\u793a\u6e90\u7801<\/li>\n\n\n\n<li>\u7f3a\u5c11 ZipArchive \u6269\u5c55\u5bfc\u81f4\u65e0\u6cd5\u81ea\u52a8\u89e3\u538b<\/li>\n\n\n\n<li>Redis \u7f13\u5b58\u914d\u7f6e\u9519\u8bef<\/li>\n\n\n\n<li>\u6570\u636e\u5e93 collation \u4e0d\u517c\u5bb9\u63d0\u793a<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u624b\u52a8\u8c03\u6574 PHP \u7ec4\u4ef6\u3001\u6e05\u7406\u7f13\u5b58\u6587\u4ef6\u4ee5\u53ca\u5408\u7406\u4f7f\u7528 wp-cli\uff0c\u53ef\u5b8c\u6574\u89e3\u51b3\u8fc1\u79fb\u4e2d\u7684\u5927\u90e8\u5206\u95ee\u9898\uff0c\u786e\u4fdd\u7ad9\u70b9\u987a\u5229\u4e0a\u7ebf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e00\u53f0 VPS \u4e0a\u5b8c\u6210\u4e86 WordPress \u7684\u8fc1\u79fb\u4e0e\u91cd\u5efa\uff0c\u4f7f\u7528 Duplicator \u63d2\u4ef6\u5bfc\u51fa\u5b8c\u6574\u5b89\u88c5\u5305\uff0c\u7ed3\u5408 Apache\u3001MariaDB \u53ca Certbot SSL \u914d\u7f6e\uff0c\u6574\u7406\u4e86\u5b8c\u6574\u7684\u5b89\u88c5\u6b65\u9aa4\u4e0e\u9047\u5230\u7684\u5e38\u89c1\u9519\u8bef\u53ca\u89e3\u51b3\u65b9\u6848\uff0c\u4f9b\u53c2\u8003\u3002 \u2705 \u57fa\u7840\u73af\u5883\u51c6\u5907 \u670d\u52a1\u5668\u73af\u5883\u57fa\u4e8e Ubuntu\u3002\u9700\u8981\u5b89\u88c5\u4ee5\u4e0b\u8f6f\u4ef6\u5305\uff1a sudo apt updatesudo apt upgrade -ysudo apt install apache2 mariadb-server php php-mysql libapache2-mod-php php-zip unzip -ysudo systemctl enable apache2 mariadbsudo systemctl start apache2 mariadb \u2705 MariaDB \u914d\u7f6e MariaDB \u9ed8\u8ba4\u4f7f\u7528 unix_socket \u63d2\u4ef6\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u8fdb\u884c\u5916\u90e8\u8fde\u63a5\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b SQL \u4fee\u6539 root &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[193],"tags":[],"class_list":["post-4589","post","type-post","status-publish","format-standard","hentry","category-abjh3eiun5cktvl"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=4589"}],"version-history":[{"count":1,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4589\/revisions"}],"predecessor-version":[{"id":4590,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4589\/revisions\/4590"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=4589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=4589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=4589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}