日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

YII 测试环境搭建

發(fā)布時間:2025/7/14 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 YII 测试环境搭建 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

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)'

  此時可以參照如下方案來解決:

  • First, you have to locate(in Terminal with "sudo find / -type s") where your mysql.sock file is located. In my case it was in /opt/lampp/var/mysql/mysql.sock
  • Fire up Terminal and issue sudo Nautilus
    This starts your Files manager with super user privileges
  • From Nautilus navigate to where your mysql.sock file is located
  • Right click on the file and select Make Link
  • Rename the Link File to mysqld.sock then Right click on the file and Cut it
  • Go to /var/run and create a folder called mysqld and enter it
  • Now right click and Paste the Link File
  • Voila! You will now have a mysqld.sock file at /var/run/mysqld/mysqld.sock :)
  • 以上都是臨時解決方案,因為重新啟動后所建立的文件和文件夾就都消失了,最終極的解決方案是打開: /opt/lampp/etc/my.cn, 修改其中的server的socket地址即可!!!!!!!
  • 第九步仍然不是最好的辦法,因為改動了/opt/lampp/etc/my.cn里邊關于socket的設置以后,原來依賴它的程序可能無法正常運行,最好的解決方案是從原來的/opt/lampp/var/mysql/mysql.sock建立一個軟鏈接到需要的地方,比如/var/run/mysqld/mysqld.sock就可以了.? 具體方法是在建立一個腳本在/etc/init/mysqld.conf
  • start on runlevel [2345] stop on runlevel [!2345] expect daemon pre-start script mkdir -p -m0755 /var/run/mysqld chown mysql:mysql /var/run/mysqld ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock end script exec /etc/init.d/mysql start pre-stop exec /etc/init.d/mysql stop

    ?

  • 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)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。