YII 测试环境搭建
1:首先按照官方指導安裝所需組件
For the local installation use following commands:
composer require "codeception/codeception=2.0.*"composer require "codeception/specify=*"composer require "codeception/verify=*"For the global installation you will need to use global directive:
composer global require "codeception/codeception=2.0.*"composer global require "codeception/specify=*"composer global require "codeception/verify=*"2:安裝完后可能會提示缺少數(shù)據(jù)庫的驅(qū)動:
可以按照命令 sudo apt-get install php5-mysql 來安裝缺少的PHP 組件
3:安裝號如上后可能會遇到錯誤提示如下:
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
此時可以參照如下方案來解決:
This starts your Files manager with super user privileges
?
4:掃平所有問題后,如在測試中有訪問數(shù)據(jù)庫,需要配置tests/config/config,配置方法參照config/db
5:在安裝過程中注意一個問題,測試環(huán)境用的是PHP CLI和APACHE用的不是同一個php
php -i | grep 'Configuration File'來查看cli的php版本
????? 編輯一個文件用瀏覽器打開 <?php phpinfo();?> 來查看阿帕奇的php版本
?
如果不是第一次安裝但是出了如上錯誤,可能還有問題是,文件的權(quán)限不對!
比如以ROOT身份操作了/opt/lampp/var/mysql下的文件以后,造成文件權(quán)限不對,也會造成這個問題,如出現(xiàn)權(quán)限問題,可以使用chmod 和 chown命令修改回來!
轉(zhuǎn)載于:https://www.cnblogs.com/wlemory/p/4616447.html
總結(jié)
以上是生活随笔為你收集整理的YII 测试环境搭建的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle生成指定表的列名,并前后添加
- 下一篇: 《猿从程序项目经理》读书笔记(八):程序