ubuntu安装yii2.0
来源:互联网 发布:围棋吃子软件 编辑:程序博客网 时间:2024/05/20 07:17
Yii2.0要求Composer必须安装 composer asset 插件。 这个插件使得Composer可以兼容实现NPM和BOWER包管理器的功能。 NPM 和 BOWER 主要用于前端资源(如js库等)的管理。
注:前提最好自己有一个git账号后面要用到
1.安装Composer
sudo curl -s http://getcomposer.org/installer | php
# 对于已经安装过Composer的,可以对其进行更新
php composer.phar self-update
2. 为Composer 安装 composer asset 插件
[注意,需要在 composer.phar的所在目录,即下载后所在目录运行如下相关命令]
php composer.phar global require "fxp/composer-asset-plugin:1.1.4"
3.现在选择的应用程序模板之一,开始安装 Yii 2.0。应用程序模板是一个包含Yii写的骨架Web应用程序包。(注:尽量切换到服务器项目目录下安装(我的目录是/usr/local/www/))
- 安装基本的应用程序模板,运行下面的命令:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.9
- 安装高级的应用程序模板,运行下面的命令:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.9
或者直接安装到指定目录:
# 使用高级模版安装Yii应用到 项目 目录下php composer.phar create-project --prefer-dist yiisoft/yii2-app-advanced /usr/local/WWW/
# 使用基础模版安装
# composer create-project --prefer-dist yiisoft/yii2-app-basic /usr/local/WWW/
安装高级模板过程中:会出现以下拦路石:
root@ctest-virtual-machine:/home/wwwroot/default# php composer.phar create-project yiisoft/yii2-app-advanced
Installing yiisoft/yii2-app-advanced (2.0.12)
- Installing yiisoft/yii2-app-advanced (2.0.12): Loading from cache
Created project in /home/wwwroot/default/yii2-app-advanced
Loading composer repositories with package information
Updating dependencies (including require-dev)
Could not fetch https://api.github.com/repos/jquery/jquery-dist, please create a GitHub OAuth token to go over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+cf8-zl-virtual-machine+2017-08-04+1634
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
Token (hidden): 此处放获取的token值
意思是拿红色url去浏览器获取一个githup上的token值 (如果没有git账号,可以先注册一个git账号),,,将获取的token值放在上面然后回车 坐等安装
注:第3步安装Yii2.0时报错:
1. Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
这个错误可以更新一下Composer 命令:php composer.phar self-update 然后再执行第3步
2. [Symfony\Component\Process\Exception\RuntimeException]
The Process class relies on proc_open, which is not available on your PHP installation.
这个错误意思是: proc_open 这个函数在php.ini中不允许使用
解决方法:打开php.ini,并搜索disable_functions指令,找到类似如下内容:disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server找到proc_open并删除即可。然后重启php-fpm /etc/init.d/php-fpm restart 再执行第3步
- ubuntu安装yii2.0
- yii2.0安装
- yii2.0安装
- YII2.0安装
- YII2.0的安装
- Yii2.0 安装
- 安装yii2.0 advanced
- yii2.0 的安装
- yii2.0 的安装
- Yii2.0的安装
- yii2.0安装
- windows下安装yii2.0
- Linux下安装Yii2.0
- yii2.0 系列一:安装
- 用composer安装YII2.0
- 用composer安装YII2.0
- 安装yii2.0 高级版
- yii2安装
- mybatis 配置中遇到的坑
- js实现点击div隐藏相应部分,再次点击显示
- 禅道远程连接数据库错误
- HDU 1841Find the Shortest Common Superstring
- SQLite学习手册(数据库和事务)
- ubuntu安装yii2.0
- python-numpy的基本用法02
- 一个前端项目,到底要集成多少库和工具
- 精仿今日头条
- HDU
- SQLite学习手册(表达式)
- 【ASP.NET】简介
- servlet方式下载之renponse详解
- Erase/Trim/Discard/Sanitize