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