安装错误

composer安装速度慢

好吧,我已经猜到会有人问有没有现成的,有!

下载百度网盘,解压vendor放到walle-web根目录即可。

第一次使用composer可能会出现的问题:1 没有添加git的token

Could not fetch https://api.github.com/repos/jquery/jquery, please create a GitHub OAuth token to go over the API rate limitHead to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+localhost+2015-10-08+1123to retrieve a token. It will be stored in “/root/.composer/auth.json” for future use by Composer.Token (hidden):

解决办法:

第一次使用composer可能会出现的问题:2 composer install 可能会出现的错误

Loading composer repositories with package informationInstalling dependencies (including require-dev)Your requirements could not be resolved to an installable set of packages. Problem 1- yiisoft/yii2 2.0.x-dev requires bower-asset/jquery 2.1.@stable | 1.11.@stable -> no matching package found.….

解决办法composer global require "fxp/composer-asset-plugin:*"

如何添加用户key到git的ssh-keys列表



  1. su - www # 假如www为你的php进程用户
    ssh-keygen -t rsa # 如果你都没有生成过rsa_key的话
    cat ~/.ssh/id_rsa.pub # 复制
    打开github/gitlab添加到你的ssh-keys或者deploy-keys


如何添加用户ssh-key到目标机群部署用户ssh-key信任

宿主机操作



  1. ps aux|grep php # 假如www_php为你的php进程用户
    su - www_php # 切换用户
    ssh-keygen -t rsa # 如果你都没有生成过rsa_key的话,如果有则跳过
    ssh-copy-id -i ~/.ssh/id_rsa.pub www_remote@remote_host # 加入目标机群信任,需要输入www_remote密码


初始化walle时失败:could not find driver

缺少pdo扩展,解决办法:添加pdo扩展



  1. ubuntu
    apt-get install php5 php5-fpm php5-mysql

    或者在源码包里编译
    cd php-src/ext/pdo_mysql
    phpize
    ./configure with-php-config=/php/install/dir/bin/php-config
    make && make install
    vi php.ini # 添加pdo_mysql.so
    restart php-fpm


7.nginx简单配置



  1. server {
    listen 80;
    server_name walle.company.com; # 改你的host
    root /the/dir/of/walle-web/web; # 根目录为web
    index index.php;

    # 建议放内网
    allow 192.168.0.0/24;
    deny all;

    location / {
    try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ .php$ {
    try_files $uri =404;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }
    }


切换用户(www)时:this account is currently not available



  1. cat /etc/passwd | grep www # 查看是否为 /sbin/nolgin


解决办法:



  1. vipw /etc/passwd
    修改/sbin/nolgin为/bin/bash


The file or directory to be published does not exists: /data/www/walle-web/vendor/bower/jquery/dist

新建此目录即可:/data/www/walle-web/vendor/bower/jquery/dist

Call to undefined function yii\web\mb_parse_str()

缺少mbstring扩展,安装mbstring扩展重启php即可。mbstring扩展:http://php.net/manual/zh/mbstring.installation.php

打赏或者star