美文网首页
自己做个网站六

自己做个网站六

作者: 多啦A梦的时光机_648d | 来源:发表于2020-03-11 19:09 被阅读0次

    这里讲一下安装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
    
    • Yarn
      安装之前先卸载老版本node
    #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
    
    • Grunt
      如果你已经拥有Node.js和NPM系统上安装跳过此步骤。 否则你需要先在系统上安装Node.js。使用以下命令集你在CentOS,RHEL系统上安装Node.js和NPM。
    # 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
    

    相关文章

      网友评论

          本文标题:自己做个网站六

          本文链接:https://www.haomeiwen.com/subject/lmngdhtx.html