Yii安装出现的问题

今天打算学习一下Yii,但是在安装过程中出现了很多问题。

通过composer安装:

composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-basic basic

第一条命令安装 Composer asset plugin,它是通过 Composer 管理 bower 和 npm 包所必须的,此命令全局生效,一劳永逸。 第二条命令会将 Yii 安装在名为 basic 的目录中,你也可以随便选择其他名称。

但是在安装过程中就报了一个异常如下:

  [Symfony\Component\Process\Exception\RuntimeException]                                   
  The Process class relies on proc_open, which is not available on your PHP installation.
![Yii安装出现的问题](https://img-blog.csdn.net/20170712135835470?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2VpeGluXzM2MzQwNzI3/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)

解决方法:

  在php.ini中,找到disable_functions选项,看看后面是否有proc_open函数被禁用了,如果有的话,去掉即可。

希望对大家有所帮助。

然而删除之后,又报了异常

[ErrorException]                                          
  proc_get_status() has been disabled for security reasons

同样道理,proc_get_status被禁用了,只要把proc_get_status删了即可。

错误还在继续。。。

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+gcan+2017-07-12+0045
to retrieve a token. It will be stored in "/home/gcan/.config/composer/auth.json" for future use by Composer.
Token (hidden): *****************************

在github的setting/Personal access tokens下面建立token,然后直接将token复制粘贴放到Token (hidden): *后面即可。

回车后如果出现

Token stored successfully.

表示token验证成功。

下面是安装进程:

Installing yiisoft/yii2-app-basic (2.0.12)
  - Installing yiisoft/yii2-app-basic (2.0.12): Loading from cache
Created project in basic
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+gcan+2017-07-12+0045
to retrieve a token. It will be stored in "/home/gcan/.config/composer/auth.json" for future use by Composer.
Token (hidden): b47aa5ca176ba184674369be830bd3fe8daaf584
Token stored successfully.
Package operations: 59 installs, 0 updates, 0 removals     
  - Installing yiisoft/yii2-composer (2.0.5): Downloading (100%)         
  - Installing swiftmailer/swiftmailer (v5.4.8): Downloading (100%)         
  - Installing bower-asset/jquery (2.2.4): Downloading (100%)         
  - Installing bower-asset/yii2-pjax (v2.0.6): Downloading (100%)         
  - Installing bower-asset/punycode (v1.3.2): Downloading (100%)         
  - Installing cebe/markdown (1.1.1): Downloading (100%)         
  - Installing ezyang/htmlpurifier (v4.9.3): Downloading (100%)         
  - Installing bower-asset/jquery.inputmask (3.3.7): Downloading (100%)         
  - Installing yiisoft/yii2 (2.0.12): Downloading (100%)         
  - Installing yiisoft/yii2-swiftmailer (2.0.7): Downloading (100%)         
  - Installing bower-asset/bootstrap (v3.3.7): Downloading (100%)         
  - Installing yiisoft/yii2-bootstrap (2.0.6): Downloading (100%)         
  - Installing yiisoft/yii2-debug (2.0.9): Downloading (100%)         
  - Installing bower-asset/typeahead.js (v0.11.1): Downloading (100%)         
  - Installing phpspec/php-diff (v1.1.0): Downloading (100%)         
  - Installing yiisoft/yii2-gii (2.0.5): Downloading (100%)         
  - Installing fzaninotto/faker (v1.6.0): Downloading (100%)         
  - Installing yiisoft/yii2-faker (2.0.3): Downloading (100%)         
  - Installing psr/log (1.0.2): Downloading (100%)         
  - Installing symfony/debug (v3.3.4): Downloading (100%)         
  - Installing symfony/polyfill-mbstring (v1.4.0): Downloading (100%)         
  - Installing symfony/console (v3.3.4): Downloading (100%)         
  - Installing stecman/symfony-console-completion (0.7.0): Downloading (100%)         
  - Installing sebastian/diff (1.4.3): Downloading (100%)         
  - Installing sebastian/recursion-context (2.0.0): Downloading (100%)         
  - Installing sebastian/exporter (2.0.0): Downloading (100%)         
  - Installing sebastian/comparator (1.2.4): Downloading (100%)         
  - Installing behat/gherkin (v4.4.5): Downloading (100%)         
  - Installing symfony/dom-crawler (v3.3.4): Downloading (100%)         
  - Installing symfony/css-selector (v3.3.4): Downloading (100%)         
  - Installing symfony/browser-kit (v3.3.4): Downloading (100%)         
  - Installing symfony/yaml (v3.3.4): Downloading (100%)         
  - Installing symfony/event-dispatcher (v3.3.4): Downloading (100%)         
  - Installing symfony/finder (v3.3.4): Downloading (100%)         
  - Installing psr/http-message (1.0.1): Downloading (100%)         
  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)         
  - Installing doctrine/instantiator (1.0.5): Downloading (100%)         
  - Installing phpunit/php-text-template (1.2.1): Downloading (100%)         
  - Installing phpunit/phpunit-mock-objects (3.4.4): Downloading (100%)         
  - Installing sebastian/version (2.0.1): Downloading (100%)         
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)         
  - Installing phpunit/php-token-stream (1.4.11): Downloading (100%)         
  - Installing phpunit/php-file-iterator (1.4.2): Downloading (100%)         
  - Installing sebastian/environment (2.0.0): Downloading (100%)         
  - Installing phpunit/php-code-coverage (4.0.8): Downloading (100%)         
  - Installing sebastian/resource-operations (1.0.0): Downloading (100%)         
  - Installing sebastian/global-state (1.1.1): Downloading (100%)         
  - Installing phpunit/php-timer (1.0.9): Downloading (100%)         
  - Installing webmozart/assert (1.2.0): Downloading (100%)         
  - Installing phpdocumentor/reflection-common (1.0): Downloading (100%)         
  - Installing phpdocumentor/type-resolver (0.2.1): Downloading (100%)         
  - Installing phpdocumentor/reflection-docblock (3.1.1): Downloading (100%)         
  - Installing phpspec/prophecy (v1.7.0): Downloading (100%)         
  - Installing myclabs/deep-copy (1.6.1): Downloading (100%)         
  - Installing sebastian/object-enumerator (2.0.1): Downloading (100%)         
  - Installing phpunit/phpunit (5.7.21): Downloading (100%)         
  - Installing codeception/base (2.3.4): Downloading (100%)         
  - Installing codeception/verify (0.3.3): Downloading (100%)         
  - Installing codeception/specify (0.4.6): Downloading (100%)         
symfony/console suggests installing symfony/filesystem ()
symfony/console suggests installing symfony/process ()
symfony/browser-kit suggests installing symfony/process ()
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/event-dispatcher suggests installing symfony/http-kernel ()
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.1)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
codeception/base suggests installing flow/jsonpath (For using JSONPath in REST module)
codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module)
codeception/base suggests installing league/factory-muffin (For DataFactory module)
codeception/base suggests installing league/factory-muffin-faker (For Faker support in DataFactory module)
codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
Writing lock file
Generating autoload files
> yii\composer\Installer::postCreateProject
chmod('runtime', 0777)...done.
chmod('web/assets', 0777)...done.
chmod('yii', 0755)...done.

当访问http://yourdomain/basic/web/index.php时,如果正常显示页面,说明Yii成功安装了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值