Exception 类yii\debug\Module不存在

Exception 类yii\debug\Module不存在,exception,reflection,yii2,Exception,Reflection,Yii2,我正在尝试在Vagran虚拟机上运行我的Yii2应用程序。作为条件,我使用Ansible。这是我的ansible剧本文件: --- - hosts: vagrant sudo: true tasks: - name: 1. install Apache apt: name=apache2 state=present - name: 1.1 Delete temporary file file: path=/var/www/web/index.html state=absent

我正在尝试在Vagran虚拟机上运行我的Yii2应用程序。作为条件,我使用Ansible。这是我的ansible剧本文件:

---
- hosts: vagrant
  sudo: true
  tasks:
- name: 1. install Apache
  apt: name=apache2 state=present

- name: 1.1 Delete temporary file
  file: path=/var/www/web/index.html state=absent

- name: 2. install PHP module for Apache
  apt: name=php5 state=latest update_cache=yes

- name: 3. Install PHP GD library
  apt: name=php5-cli state=latest

- name: 4. Start Apache
  service: name=apache2 state=running enabled=yes

- name: 5. Install MySQL
  apt: pkg=mysql-server state=present

- name: 6. Install python-mysqldb
  apt: pkg=python-mysqldb state=present

- name: 7. Install PHP MySQL bindings
  apt: pkg=php5-mysql state=present

- name: 8. Restart apache
  service: name=apache2 state=restarted

- name: 9. Set MySQL root password
  debconf: name='mysql-server' question='mysql-server/root_password' value='password' vtype='password'

- name: 10. Confirm MySQL root password before installing
  debconf: name='mysql-server' question='mysql-server/root_password_again' value='password' vtype='password'

- name: 11. Database creation with name gitSearch 
  mysql_db: name=gitSearch state=present

- name: 12.a Copy database dump
  copy: src=../gitSearch.sql.bz2 dest=/tmp/gitSearch.sql.bz2 

- name: 12.b Copy database dump
  mysql_db: name=gitSearch state=import target=/tmp/gitSearch.sql.bz2

- name: 13. Ensure curl is installed
  apt: pkg=curl state=installed
  when: ansible_os_family == 'Debian'

- name: 14. Install Composer into the current directory
  shell: >
    curl -sS https://getcomposer.org/installer | php
    creates=/usr/local/bin/composer

- name: 15. Install php5-curl
  apt: name=php5-curl state=latest update_cache=yes

- name: 16. Move Composer into globally-accessible location.
  shell: >
    mv composer.phar /usr/local/bin/composer
    creates=/usr/local/bin/composer

- name: 18. Update dependencies v2
  composer: command=install working_dir=/var/www
当我运行我的项目时,我有一个异常:

ReflectionException

Class yii\debug\Module does not exist
in /var/www/vendor/yiisoft/yii2/di/Container.php
我认为问题在于composer,因为在提供composer任务之前,一切都很好。在我当地的机器上(不是流浪者的盒子),一切都很好。配置中的调试器部分:

$config['modules']['debug']['class'] = 'yii\debug\Module';
$config['modules']['debug']['allowedIPs'] = ['*']; 

似乎未安装调试模块和/或Gii模块

请检查yii2项目根目录中的
composer.json
文件,并确保composer文件的
require dev
部分中存在以下行:
“yiisoft/yii2 debug”:“~2.0”
“yiisoft/yii2 gii”:“~2.0”

然后在项目的根目录中运行
composer update

如果这不是问题所在,你可能


快乐编码

似乎未安装调试模块和/或Gii模块

请检查yii2项目根目录中的
composer.json
文件,并确保composer文件的
require dev
部分中存在以下行:
“yiisoft/yii2 debug”:“~2.0”
“yiisoft/yii2 gii”:“~2.0”

然后在项目的根目录中运行
composer update

如果这不是问题所在,你可能


快乐编码

谢谢!出现此问题的原因是通过Ansible执行的编写器无效。现在它工作了!)伟大的还有,你让我了解了Ansible;这真是一个了不起的工具。谢谢!出现此问题的原因是通过Ansible执行的编写器无效。现在它工作了!)伟大的还有,你让我了解了Ansible;这真是一个了不起的工具。