日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

搭建WordPress个人网站

發布時間:2025/3/21 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 搭建WordPress个人网站 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

準備域名

搭建網站的第一步肯定擁有一個自己的域名(當然愿意用IP地址直接訪問也沒什么問題),域名購買途徑很多,阿里云、騰訊云、百度云等服務器供應商都能購買域名,一般建議域名和服務器都在同一個平臺購買,會很方便。

域名購買成功后緊隨的就是域名的實名認證和域名備案,都可以在購買域名的供應商處完成,域名備案時間7到15個工作日不等,快的甚至3個工作日就能完成

準備服務器

想要運行Wordpress網站程序,必須要有對應的軟件,也就是服務器環境,比如我們常說的LNMP就是 Linux + Nginx + Mysql + PHP 環境,最常見的網站程序,Wordpress程序就是結合這些語言開發出來的。

其實環境里面安裝LNMP是眾所周知的,這里我要說的是軟件的版本,服務器不同于虛擬主機,我們可以自主控制各種程序的參數和版本,這將讓網站的配置非常靈活。為了wordpress兼容和性能,關于軟件版本的選擇有一個很好的標準就是wordpress官方推薦環境,官方的建議是PHP7.2版本及以上,Mysql5.6版本及以上,還有就是https,安裝軟件的的原則就是版本越接近推薦的越好

接下來就讓我們從使用服務器命令開始,搭建Wordpress網站的LNMP環境

mysql資源庫地址

官網下載MySQL包

nginx官方下載

php官方下載

wordpress中文官方下載

lnmp軟件包地址

安裝lnmp

安裝mysql
[root@VM-0-17-centos ~]# mkdir -p /wordpress/mysql [root@VM-0-17-centos ~]# rpm -q wget || yum -y install wget && wget -P /opt https://repo.mysql.com/yum/mysql-8.0-community/el/7/aarch64/mysql80-community-release-el7-3.noarch.rpm [root@VM-0-17-centos ~]# cd /opt/ [root@VM-0-17-centos opt]# yum -y install mysql80-community-release-el7-3.noarch.rpm [root@VM-0-17-centos ~]# yum makecache [root@VM-0-17-centos ~]# yum repolist Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile repo id repo name status epel/7/x86_64 EPEL for redhat/centos 7 - x86_64 13,441 extras/7/x86_64 Qcloud centos extras - x86_64 413 mysql-connectors-community/x86_64 MySQL Connectors Community 165 mysql-tools-community/x86_64 MySQL Tools Community 115 mysql80-community/x86_64 MySQL 8.0 Community Server 193 os/7/x86_64 Qcloud centos os - x86_64 10,068+2 updates/7/x86_64 Qcloud centos updates - x86_64 1,127 repolist: 25,522 [root@VM-0-17-centos ~]# yum -y install mysql-community-server.x86_64 [root@VM-0-17-centos ~]# yum -y install mysql-community-libs-compat.x86_64 mysql-community-devel.x86_64 [root@VM-0-17-centos ~]# sed -i "/datadir=/s/\/var\/lib\/mysql/\/wordpress\/mysql/" /etc/my.cnf # 將數據庫的默認存放位置修改為/wordpress/mysql# 執行數據庫的初始化,ps:執行數據庫初始化之前一定要確保/var/lib/mysql目錄下是空的,否則無法執行初始化 [root@VM-0-17-centos ~]# mysqld --initialize-insecure --user=mysql -- datadir=/wordpress/mysql [root@VM-0-17-centos ~]# chown -R mysql.mysql /wordpress/mysql [root@VM-0-17-centos ~]# systemctl start mysqld [root@VM-0-17-centos ~]# ss -nutlp | grep 3306 tcp LISTEN 0 70 [::]:33060 [::]:* users:(("mysqld",pid=13455,fd=31)) tcp LISTEN 0 128 [::]:3306 [::]:* users:(("mysqld",pid=13455,fd=33)) [root@VM-0-17-centos ~]# mysql -e "alter user root@'localhost' identified by 'tian1234.Q' " # 修改密碼 [root@VM-0-17-centos ~]# sed -i '4a default_authentication_plugin=mysql_native_password' /etc/my.cnf # 更改默認的身份認證插件,需要重啟服務才能生效 [root@VM-0-17-centos ~]# systemctl restart mysqld [root@VM-0-17-centos ~]# ss -nutlp | grep 3306 tcp LISTEN 0 70 [::]:33060 [::]:* users:(("mysqld",pid=16656,fd=31)) tcp LISTEN 0 128 [::]:3306 [::]:* users:(("mysqld",pid=16656,fd=33))
安裝Nginx
[root@VM-0-17-centos ~]# wget -P /opt http://nginx.org/download/nginx-1.18.0.tar.gz [root@VM-0-17-centos ~]# wget -P /opt https://wordpress.org/latest.zip [root@VM-0-17-centos ~]# yum -y install make gcc openssl-devel pcre-devel zlib-devel [root@VM-0-17-centos ~]# cd /opt/-1.18.0 [root@VM-0-17-centos nginx-1.18.0]# ./configure --prefix=/wordpress/nginx --user=nginx --group=nginx --with-http_ssl_module --with-stream --with-debug --with-http_realip_module --with-http_gzip_static_module --with-stream_realip_module --with-http_gunzip_module --with-http_stub_status_module --with-stream_ssl_module --with-http_v2_module --with-http_dav_module --with-http_flv_module --with-http_addition_module --with-http_mp4_module[root@VM-0-17-centos nginx-1.18.0]# make && make install [root@VM-0-17-centos nginx-1.18.0]# useradd -s /sbin/nologin nginx -M [root@VM-0-17-centos nginx-1.18.0]# cd /wordpress/nginx [root@VM-0-17-centos nginx]# vim conf/nginx.conf http {include mime.types; # 主模塊指令,實現對配置文件所包含的文件設定,可以減少主配置文件的復雜度,類似apache中的include方法。default_type application/octet-stream; # 屬于http核心模塊指令,這里默認類型為二進制流,也就是當文件類型未定義是使用這種方式,例如在沒有配置php環境時,nginx是不予解析的,此時,用瀏覽器訪問php文件就會出現下載窗口 server_tokens off; # 隱藏版本號server_names_hash_bucket_size 512; # 服務器名字的hash表大小client_header_buffer_size 32k; # 請求行+請求頭的標準大小為32klarge_client_header_buffers 4 32k; # 請求行(request line)的大小不能超過32k,否則返回414錯誤,請求頭(request header)中的每一個頭部字段的大小不能超過32k,否則返回400錯誤(實際是494錯誤,但nginx統一返回400了),curl -H "header1=aaa" -H "header2=bbb" -v http://127.0.0.1/,這里的header1=xxx和header2=xxx就是請求頭中的頭部字段,(請求行+請求頭)的大小不能超過128k(4 * 32k)client_max_body_size 50m; # 上傳文件大小限制# FastCGI相關參數是為了改善網站的性能:減少資源占用,提高訪問速度。fastcgi_connect_timeout 300; # 指定連接到后端fastcgi的超時時間fastcgi_send_timeout 300; # 向fastCGI請求的超時時間,這個值是指已經完成兩次握手后向fastCGI傳送的超時時間fastcgi_read_timeout 300; # 接收fastCGI應答的超時時間,這個值已經完成兩次握手后接收fastCGI應答的超時時間fastcgi_buffer_size 64k; # 指定讀取fastCGI應答第一部分需要用多大的緩沖區,一般第一部分應答不會超過1k,一般設置為64kfastcgi_buffers 4 64k; # 指定本地需要用多少和多大的緩沖區來緩沖fastCGI的應答fastcgi_busy_buffers_size 128k; # 默認值是fastcgi_buffers的兩倍fastcgi_temp_file_write_size 256k; # 在寫入fastcgi_temp_path是用多大的數據塊,默認值是fastcgi_buffers兩倍fastcgi_intercept_errors on; # 這個指令指定是否傳遞4xx和5xx錯誤信息到客戶端,或者允許nginx使用error_page處理錯誤信息。 tcp_nodelay on; # 這個選項在將連接轉變為長連接的時候才被啟用,或者在upstream發送響應到客戶端時也會啟用。 keepalive_timeout 65; # 一個請求完成之后還要保持連接多久,不是請求時間多久,目的是保持長連接,減少創建連接過程給系統帶來的性能損耗,類似于線程池,數據庫連接池。gzip on; # 開啟gzip壓縮輸出gzip_min_length 1k; # 用于設置允許壓縮的頁面最小字節數,頁面字節數從header頭的content-length中獲取,默認值是0,不管頁面多大都進行壓縮,建議設置成大于1k的字節數,小于1k可能會越壓越大gzip_buffers 4 16k; # 表示申請4個單位為16k的內存作為壓縮結果流緩存,默認值是申請與原始數據大小相同的內存空間來存儲gzip壓縮結果gzip_http_version 1.1; # 壓縮版本(默認1.1,前端如果是squid2.5請使用1.0)gzip_comp_level 2; # 壓縮等級gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; # 壓縮的類型gzip_vary on; # 使前端的緩存服務器緩存經過gzip壓縮的頁面gzip_proxied expired no-cache no-store private auth; # 當請求頭的信息來自代理服務器時,在請求頭中包含expired則開啟壓縮gzip_disable "MSIE [1-6]\."; # 禁用IE6的gzip壓縮limit_conn_zone $binary_remote_addr zone=perip:10m; # 指令指定一個會話的最大同時連接數,超過這個數字的請求將被返回”Service unavailable” (503)代碼。limit_conn_zone $server_name zone=perserver:10m; # 指令描述會話狀態存儲區域。會話的數目按照指定的變量來決定,它依賴于使用的變量大小和memory_max_size的值include /wordpress/nginx/myweb/*.conf; 67 server {68 listen 80;69 server_name 106.54.95.242; # 改為自己的ip [root@VM-0-17-centos nginx]# mkdir www myweb [root@VM-0-17-centos nginx]# cd myweb/ [root@VM-0-17-centos myweb]# touch wordpress.conf [root@VM-0-17-centos myweb]# vim wordpress.conf server {listen 80;server_name tianatian.icu ; location / {root /wordpress/nginx/www/wordpress;index index.php index.html index.htm;#charset koi8-r; }#access_log "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G" main;error_page 500 502 503 504 /50x.html ;location = /50x.html {root html; } location ~ \.php$ {root /wordpress/nginx/www/wordpress; fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;} } # 將Wordpress傳到Nginx目錄下面,使WordPress可以被訪問 [root@VM-0-17-centos myweb]# cd /opt/ [root@VM-0-17-centos opt]# ls # 上傳WordPress軟件包 latest.zip nginx-1.18.0 wordpress-5.4.2-zh_CN.tar.gz mysql80-community-release-el7-3.noarch.rpm nginx-1.18.0.tar.gz [root@VM-0-17-centos opt]# tar -xf wordpress-5.4.2-zh_CN.tar.gz [root@VM-0-17-centos opt]# mv wordpress /wordpress/nginx/www/
安裝php
[root@VM-0-17-centos opt]# wget https://www.php.net/distributions/php-7.3.22.tar.gz [root@VM-0-17-centos opt]# yum -y install zlib zlibxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2 libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel openssl-devel libxslt-devel libicu-devel gcc-c++ [root@VM-0-17-centos opt]# tar -xf php-7.3.22.tar.gz [root@VM-0-17-centos opt]# cd php-7.3.22/ [root@VM-0-17-centos php-7.3.22]# ./configure \ > --prefix=/wordpress/php \ > --with-fpm-user==php --with-fpm-group=php \ > --with-mysqli=mysqlnd \ > --enable-embedded-mysqli \ > --with-mysql-sock=/var/lib/mysql/mysql.sock \ > --with-pdo-mysql=mysqlnd \ > --enable-mysqlnd \ > --with-zlib \ > --enable-fpm \ > --with-openssl \ > --enable-debug \ > --with-freetype-dir \ > --with-png-dir \ > --with-gd \ > --enable-gd-jis-conv \ > --with-jpeg-dir \ > --enable-sockets \ > --enable-mbstring \ > --enable-bcmath \ > --with-config-file-path=/wordpress/php/etc \ > --with-libxml-dir \ > --with-curl \ > --enable-ftp \ > --enable-intl \ > --with-mhash \ > --enable-soap \ > --enable-maintainer-zts \ > --with-pear \ > --disable-fileinfo \ > --disable-rpath \ > --with-gettext --enable-sysvsem \ > --enable-cli \ > --enable-phpdbg-readline=/wordpress/php/etc # 此路徑寫php配置文件路徑 [root@VM-0-17-centos php-7.3.22]# cp php.ini-production /wordpress/php/etc/php.ini [root@VM-0-17-centos php-7.3.22]# cp sapi/fpm/init.d.php-fpm /wordpress/php/bin/php-fpm [root@VM-0-17-centos php-7.3.22]# cp /wordpress/php/etc/php-fpm.conf.default /wordpress/php/etc/php-fpm.conf [root@VM-0-17-centos php-7.3.22]# cp /wordpress/php/etc/php-fpm.d/www.conf.default /wordpress/php/etc/php-fpm.d/www.conf [root@VM-0-17-centos php-7.3.22]# chmod +x /wordpress/php/bin/php-fpm [root@VM-0-17-centos php-7.3.22]# useradd -s /sbin/nologin php -M
起服務
[root@VM-0-17-centos ~]# /wordpress/nginx/sbin/nginx [root@VM-0-17-centos ~]# ss -nutlp | grep :80 tcp LISTEN 0 128 *:80 *:* users:(("nginx",pid=10027,fd=6),("nginx",pid=10026,fd=6)) [root@VM-0-17-centos ~]# systemctl start mysqld [root@VM-0-17-centos ~]# systemctl enable mysqld [root@VM-0-17-centos ~]# ss -nutlp | grep 3306 tcp LISTEN 0 70 [::]:33060 [::]:* users:(("mysqld",pid=16656,fd=31)) tcp LISTEN 0 128 [::]:3306 [::]:* users:(("mysqld",pid=16656,fd=33)) [root@VM-0-17-centos ~]# /wordpress/php/bin/php-fpm start Starting php-fpm done [root@VM-0-17-centos ~]# ss -nutlp | grep 9000 tcp LISTEN 0 128 127.0.0.1:9000 *:* users:(("php-fpm",pid=12052,fd=5),("php-fpm",pid=12051,fd=5),("php-fpm",pid=12050,fd=7))
創建一個數據庫wordpress
[root@VM-0-17-centos ~]# mysql -uroot -ptian1234.Q mysql> create database wordpress character set utf8mb4; Query OK, 1 row affected (0.01 sec)mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | wordpress | +--------------------+ 5 rows in set (0.01 sec) mysql> create user wordpress@"localhost" identified by "123qqq...A"; Query OK, 0 rows affected (0.02 sec) mysql> grant all privileges on wordpress.* to wordpress@"localhost"; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec)[root@VM-0-17-centos ~]# vim /etc/my.cnf [mysqld] default_authentication_plugin=mysql_native_password port=3306 server_id=1 log-bin=mysql-bin slow_query_log=1 slow-query-log-file=/var/log/mysql-slow.log long_query_time=3 [root@VM-0-17-centos ~]# systemctl restart mysqld [root@VM-0-17-centos ~]# ss -nutlp | grep mysqld tcp LISTEN 0 70 [::]:33060 [::]:* users:(("mysqld",pid=26208,fd=31)) tcp LISTEN 0 128 [::]:3306 [::]:* users:(("mysqld",pid=26208,fd=33))
DNS解析



配置ssl證書
# 注意:證書的位置必須是在nginx安裝目錄下的cert這個目錄里 # 當證書狀態變為已頒發,下載證書的zip壓縮包上傳到Nginx安裝目錄的cert中[root@VM-0-17-centos ~]# cd /wordpress/nginx/ [root@VM-0-17-centos nginx]# mkdir cert [root@VM-0-17-centos nginx]# cd cert # 上傳證書壓縮包 [root@VM-0-17-centos cert]# ls tianatian.icu.zip www.tianatian.icu.zip# 解壓縮 [root@VM-0-17-centos cert]# unzip tianatian.icu.zip [root@VM-0-17-centos cert]# unzip www.tianatian.icu.zip# 修改配置文件 [root@VM-0-17-centos cert]# cd ../myweb/ [root@VM-0-17-centos myweb]# vim wordpress.conf server {listen 80; server_name tianatian.icu ; # 換成自己的域名return 301 https://$server_name$request_uri; # 重定向 location / {root /wordpress/nginx/www/wordpress;index index.php index.html index.htm;#charset koi8-r;} } server {listen 443 ssl;server_name tianatian.icu;root www/wordpress; index index.php index.html index.htm; ssl_certificate /wordpress/nginx/cert/Nginx/1_tianatian.icu_bundle.crt; # 換成剛剛解壓縮后的crt證書文件名ssl_certificate_key /wordpress/nginx/cert/Nginx/2_tianatian.icu.key; # 換成剛剛解壓縮后的key密鑰文件名 ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; # 配置跨域訪問location / { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; }location ~ \.php$ {root /wordpress/nginx/www/wordpress; fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;} }# 重啟服務 [root@VM-0-17-centos myweb]# ../sbin/nginx -t nginx: the configuration file /wordpress/nginx/conf/nginx.conf syntax is ok nginx: configuration file /wordpress/nginx/conf/nginx.conf test is successful [root@VM-0-17-centos myweb]# ../sbin/nginx -s reload [root@VM-0-17-centos myweb]# ss -nutlp | grep nginx tcp LISTEN 0 128 *:443 *:* users:(("nginx",pid=16419,fd=10),("nginx",pid=10026,fd=10)) tcp LISTEN 0 128 *:80 *:* users:(("nginx",pid=16419,fd=6),("nginx",pid=10026,fd=6))
訪問域名進行安裝
  • 左上角出現小鎖頭表示https協議已經生效,點擊現在就開始

  • 填寫數據庫的用戶名密碼信息,點擊提交

  • 手動寫入wp-config.php文件到網頁的根目錄

# 將提示文件復制到網頁的根目錄中 [root@VM-0-17-centos ~]# cd /wordpress/nginx/www/wordpress/ [root@VM-0-17-centos wordpress]# vim wp-config.php <?php /*** WordPress基礎配置文件。** 這個文件被安裝程序用于自動生成wp-config.php配置文件,* 您可以不使用網站,您需要手動復制這個文件,* 并重命名為“wp-config.php”,然后填入相關信息。** 本文件包含以下配置選項:** * MySQL設置* * 密鑰* * 數據庫表名前綴* * ABSPATH** @link https://codex.wordpress.org/zh-cn:%E7%BC%96%E8%BE%91_wp-config.php** @package WordPress*/// ** MySQL 設置 - 具體信息來自您正在使用的主機 ** // /** WordPress數據庫的名稱 */ define( 'DB_NAME', 'wordpress' );/** MySQL數據庫用戶名 */ define( 'DB_USER', 'wordpress' );/** MySQL數據庫密碼 */ define( 'DB_PASSWORD', '123qqq...A' );/** MySQL主機 */ define( 'DB_HOST', 'localhost' );/** 創建數據表時默認的文字編碼 */ define( 'DB_CHARSET', 'utf8mb4' );/** 數據庫整理類型。如不確定請勿更改 */ define( 'DB_COLLATE', '' );/**#@+* 身份認證密鑰與鹽。** 修改為任意獨一無二的字串!* 或者直接訪問{@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org密鑰生成服務}* 任何修改都會導致所有cookies失效,所有用戶將必須重新登錄。** @since 2.6.0*/ define( 'AUTH_KEY', '25q<}/ztS2t@tlu:|SWu|4~,c0{8$-SBqxH|An@Y<u4Da#B!<AdZ7#zku)!<uF^y' ); define( 'SECURE_AUTH_KEY', '1[C:RfT$DtJ`C{jg&%VI]lb2dPlur&f$V%&P/!Ecinh^4SK1^zUq9.Z8~b<?tQ%B' ); define( 'LOGGED_IN_KEY', 'C2D3Dh1:>4Io5a;Dn_xZC3WELT>a(,%XiQ)~~#;S?<=+/BHwMof)K}~PKX>F>lx.' ); define( 'NONCE_KEY', 'r$>;}<Uyd$~LhQn^MCMN#,/g,_L}usYn%c}hzTzxAR+0Oo#doF0 _8hY3<Wi|R3T' ); define( 'AUTH_SALT', '(5SNjDi2i_}3bq6D=?m`nn;vuRgJ%e)Zk`KdsaRtrWgu_N*rrzU$X(;1f:DW`#4T' ); define( 'SECURE_AUTH_SALT', '97=?jnn0<rHdij.0;@kfOk*Gn_o[J)9Rj<NKUeI9E6K|}xi#t&.*l|L/xLu&s#&@' ); define( 'LOGGED_IN_SALT', '1-OSp5ruxbkG<Js-v?}*s4}$lyE3Fn(dx3)1@:^T;;%Y;MQ]uR,3^z&}ty~;2OGI' ); define( 'NONCE_SALT', 'Jmn:o{,H>9r;[_kM=t{l@R>8]|-iI$`3t(_uh-X5<|C]?u_<7]yvm35@tLb/PU{d' );/**#@-*//*** WordPress數據表前綴。** 如果您有在同一數據庫內安裝多個WordPress的需求,請為每個WordPress設置* 不同的數據表前綴。前綴名只能為數字、字母加下劃線。*/ $table_prefix = 'wp_';/*** 開發者專用:WordPress調試模式。** 將這個值改為true,WordPress將顯示所有用于開發的提示。* 強烈建議插件開發者在開發環境中啟用WP_DEBUG。** 要獲取其他能用于調試的信息,請訪問Codex。** @link https://codex.wordpress.org/Debugging_in_WordPress*/ define('WP_DEBUG', false);/* 好了!請不要再繼續編輯。請保存本文件。使用愉快! *//** WordPress目錄的絕對路徑。 */ if ( ! defined( 'ABSPATH' ) ) {define( 'ABSPATH', dirname( __FILE__ ) . '/' ); }/** 設置WordPress變量和包含文件。 */ require_once( ABSPATH . 'wp-settings.php' );
  • 返回web頁面繼續下一步安裝

  • 輸入用戶名密碼登錄

ftp問題

# 每當我們想在wordpress上升級插件或者是升級wordpress的時候,就會彈出一個ftp登錄,但是我們怎么跳過ftp登錄呢 [root@VM-0-17-centos wordpress]# vim wp-config.php define("FS_METHOD","direct"); define("FS_CHMOD_DIR", 0777); define("FS_CHMOD_FILE", 0777);[root@VM-0-17-centos wordpress]# chown -R 777 /wordpress/nginx/www/wordpress/ [root@VM-0-17-centos wordpress]# chown -R nginx:nginx /wordpress/nginx/www/wordpress/此時再次去到儀表板,點擊更新就不再提示輸入ftp了

其他問題
在更新Akismet Anti-Spam時發生了錯誤:無法創建目錄# 解決辦法:簡單粗暴 [root@VM-0-17-centos wordpress]# pwd /wordpress/nginx/www/wordpress [root@VM-0-17-centos wordpress]# ll total 212 -rw-r--r-- 1 777 nginx 405 Feb 6 2020 index.php -rw-r--r-- 1 777 nginx 19915 Feb 12 2020 license.txt -rw-r--r-- 1 777 nginx 7005 Aug 3 12:00 readme.html -rw-r--r-- 1 777 nginx 6912 Feb 6 2020 wp-activate.php drwxr-xr-x 9 777 nginx 4096 Aug 3 12:00 wp-admin -rw-r--r-- 1 777 nginx 351 Feb 6 2020 wp-blog-header.php -rw-r--r-- 1 777 nginx 2332 Jun 3 04:26 wp-comments-post.php -rw-r--r-- 1 777 nginx 3062 Sep 15 10:49 wp-config.php -rw-r--r-- 1 777 nginx 2776 Aug 3 12:00 wp-config-sample.php drwxr-xr-x 5 777 nginx 4096 Aug 3 12:00 wp-content -rw-r--r-- 1 777 nginx 3940 Feb 6 2020 wp-cron.php drwxr-xr-x 21 777 nginx 12288 Aug 3 12:00 wp-includes -rw-r--r-- 1 777 nginx 2496 Feb 6 2020 wp-links-opml.php -rw-r--r-- 1 777 nginx 3300 Feb 6 2020 wp-load.php -rw-r--r-- 1 777 nginx 47874 Feb 10 2020 wp-login.php -rw-r--r-- 1 777 nginx 8509 Apr 14 19:34 wp-mail.php -rw-r--r-- 1 777 nginx 19396 Apr 10 11:59 wp-settings.php -rw-r--r-- 1 777 nginx 31111 Feb 6 2020 wp-signup.php -rw-r--r-- 1 777 nginx 4755 Feb 6 2020 wp-trackback.php -rw-r--r-- 1 777 nginx 3133 Feb 6 2020 xmlrpc.php [root@VM-0-17-centos wordpress]# chmod 777 -R . [root@VM-0-17-centos wordpress]# ll total 212 -rwxrwxrwx 1 nginx nginx 405 Feb 6 2020 index.php -rwxrwxrwx 1 nginx nginx 19915 Feb 12 2020 license.txt -rwxrwxrwx 1 nginx nginx 7005 Aug 3 12:00 readme.html -rwxrwxrwx 1 nginx nginx 6912 Feb 6 2020 wp-activate.php drwxrwxrwx 9 nginx nginx 4096 Aug 3 12:00 wp-admin -rwxrwxrwx 1 nginx nginx 351 Feb 6 2020 wp-blog-header.php -rwxrwxrwx 1 nginx nginx 2332 Jun 3 04:26 wp-comments-post.php -rwxrwxrwx 1 nginx nginx 3062 Sep 15 10:49 wp-config.php -rwxrwxrwx 1 nginx nginx 2776 Aug 3 12:00 wp-config-sample.php drwxrwxrwx 5 nginx nginx 4096 Aug 3 12:00 wp-content -rwxrwxrwx 1 nginx nginx 3940 Feb 6 2020 wp-cron.php drwxrwxrwx 21 nginx nginx 12288 Aug 3 12:00 wp-includes -rwxrwxrwx 1 nginx nginx 2496 Feb 6 2020 wp-links-opml.php -rwxrwxrwx 1 nginx nginx 3300 Feb 6 2020 wp-load.php -rwxrwxrwx 1 nginx nginx 47874 Feb 10 2020 wp-login.php -rwxrwxrwx 1 nginx nginx 8509 Apr 14 19:34 wp-mail.php -rwxrwxrwx 1 nginx nginx 19396 Apr 10 11:59 wp-settings.php -rwxrwxrwx 1 nginx nginx 31111 Feb 6 2020 wp-signup.php -rwxrwxrwx 1 nginx nginx 4755 Feb 6 2020 wp-trackback.php -rwxrwxrwx 1 nginx nginx 3133 Feb 6 2020 xmlrpc.php 此時重新查看,可以發現插件已經可以更新了

總結

以上是生活随笔為你收集整理的搭建WordPress个人网站的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。