自己做个网站六

2020-03-11  本文已影响0人  多啦A梦的时光机_648d

这里讲一下安装Yoast SEO

第一步安装依赖

# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
# php composer-setup.php

All settings correct for using Composer
Downloading...

Composer (version 1.6.5) successfully installed to: /root/composer.phar
Use it: php composer.phar

移动 composer.phar,这样 composer 就可以进行全局调用:

# mv composer.phar /usr/local/bin/composer

切换为国内镜像:

# composer config -g repo.packagist composer https://packagist.phpcomposer.com

更新 composer:

# composer selfupdate
#yum remove nodejs npm -y
#curl --silent --location https://rpm.nodesource.com/setup_8.x | #sudo bash -
#sudo yum -y install nodejs
#curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
#sudo yum install yarn
# yum install -y gcc-c++ make
# curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
# yum install nodejs

安装使用Grunt NPM

(base) [root@VM_0_11_centos wordpress-seo]# npm install -g grunt
/usr/bin/grunt -> /usr/lib/node_modules/grunt/bin/grunt
+ grunt@1.0.4
added 96 packages from 63 contributors in 155.237s

安装之后确保安装成功检查版本

(base) [root@VM_0_11_centos wordpress-seo]# grunt --version
grunt-cli v1.2.0
grunt v1.0.4

第二步:安装SEO

composer install

报错

(base) [root@VM_0_11_centos wordpress-seo]# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for humbug/php-scoper 0.12.4 -> satisfiable by humbug/php-scoper[0.12.4].
    - humbug/php-scoper 0.12.4 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.

解决办法直接忽略版本

#composer install --ignore-platform-reqs
或者
#composer update --ignore-platform-reqs
yarn
grunt build

你可以在Wordpress dashboard中看到一个SEO选项,就是它了!



到插件处点击setting进行设置
最后参考这里:

https://mp.weixin.qq.com/s?src=11&timestamp=1583834821&ver=2208&signature=zlyJnBvB6eXPN7pd1hjfXekjXEZvKVT-RIX30HHBCRZifpg0WeLm*DnM2cjMvPOqeq1S1OpuO0YxQj*a5WCMgbk68ae5TqIkI-uYoXnUVnT*pF3mcA4kO6dTjbUwHswm&new=1
上一篇下一篇

猜你喜欢

热点阅读