最近项目需要,学习了一下yii2.0框架

第一步:  安装composer--------作为一个phper  composer不会用可能有点不合适

下载composer.phar文件
#curl -sS https://getcomposer.org/installer | php出现表示下载成功.
运行 php composer.phar 会出现composer的标志。
php composer.phar
移动或复制composer.phar 到系统 bin 目录
#mv composer.phar /usr/local/bin/composer
#cp composer.phar /usr/local/bin/composer
修改composer文件的权限
#chmod 744 /usr/local/bin/composer

第二步:从git分支上拉取代码

#git clone http://yourservername/basic.git

第三部:安装yii的核心库

进入你的git clone的网站根目录执行:
#composer install

如果执行install失败,出现

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 2
- Installation request for myclabs/deep-copy 1.8.1 -> satisfiable by myclabs/deep-copy[1.8.1].
- myclabs/deep-copy 1.8.1 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 3
- Installation request for symfony/browser-kit v4.2.4 -> satisfiable by symfony/browser-kit[v4.2.4].
- symfony/browser-kit v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 4
- Installation request for symfony/console v4.2.4 -> satisfiable by symfony/console[v4.2.4].
- symfony/console v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 5
- Installation request for symfony/contracts v1.0.2 -> satisfiable by symfony/contracts[v1.0.2].
- symfony/contracts v1.0.2 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 6
- Installation request for symfony/css-selector v4.2.4 -> satisfiable by symfony/css-selector[v4.2.4].
- symfony/css-selector v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 7
- Installation request for symfony/dom-crawler v4.2.4 -> satisfiable by symfony/dom-crawler[v4.2.4].
- symfony/dom-crawler v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 8
- Installation request for symfony/event-dispatcher v4.2.4 -> satisfiable by symfony/event-dispatcher[v4.2.4].
- symfony/event-dispatcher v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 9
- Installation request for symfony/finder v4.2.4 -> satisfiable by symfony/finder[v4.2.4].
- symfony/finder v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 10
- Installation request for symfony/yaml v4.2.4 -> satisfiable by symfony/yaml[v4.2.4].
- symfony/yaml v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 11
- symfony/browser-kit v4.2.4 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
- codeception/base 2.3.9 requires symfony/browser-kit >=2.7 <5.0 -> satisfiable by symfony/browser-kit[v4.2.4].
- Installation request for codeception/base 2.3.9 -> satisfiable by codeception/base[2.3.9].

说明php版本问题执行:

composer install --ignore-platform-reqs

这样  yii框架就安装好了

然后进入你的nginx配置文件  找到nginx.conf 配置一个server

#可以直接复制  将servername改成自己的  yourpath 改成项目实际地址即可
server {
charset utf-;
client_max_body_size 128M;
listen ;
server_name yourservername;
root /yourpath/web;
index index.php index.html;
access_log /yourpath/log/access.log;
error_log /yourpath/log/error.log;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:;
try_files $uri =;
}
location ~* /\. {
deny all;
}
}

然后重启nginx

访问你自己配置的域名  出现下面的页面说明yii已经部署完毕

以上为博主原创,博客唯一地址:https://www.cnblogs.com/pfdltutu/p/10557754.html

最新文章

  1. 如何给SVG填充和描边应用线性渐变
  2. Cordova环境搭建 &amp; HelloWorld
  3. 2016最新cocoapods安装流程,安装过程中遇到的问题及解决方法
  4. SQL语句之备份表
  5. 删除div
  6. MooFest_二维树状数组
  7. [转]Android 应用的自动升级、更新模块的实现
  8. Spring 数据源配置一:单一数据源
  9. vertical-align:top属性
  10. 金洪林:红邦创衣止于至善_品牌-生活时尚_品牌_YOKA时尚网
  11. 使用hbase的api创建表时出现的异常
  12. 扩展KMP——算法总结,来自于 迷路的鸽子
  13. linux 编辑文件时 E45: &#39;readonly&#39; option is set (add ! to override) 隐藏属性 chattr lsattr
  14. API创建员工联系人
  15. React native中使用XMLHttpRequest请求数据
  16. Python基础(十三) 为什么说python多线程没有真正实现多现程
  17. Shell 实践、常用脚本进阶
  18. Android &amp; iOS 启动画面工具
  19. 加快maven中jar包的下载速度,maven镜像收集
  20. Docker中使用createdump调试coreclr

热门文章

  1. C#文件或文件夹压缩和解压
  2. JQuery事件绑定bind、live、on、trigger
  3. 深入理解JS中&amp;&amp;和||
  4. 在dubbo工程中,使用druid监控
  5. Hive跨集群迁移
  6. futex的设计与实现
  7. F5健康检查导致的服务端连接异常RST
  8. Tomcat7/8/8.5三种版本的redis-session-manager的jar和xml配置均不同
  9. Intellij IDEA 2019 最新优化配置
  10. iOS popToViewController具体用法