1. 程式人生 > >testlink 1.9.8 Win7 64位作業系統下搭建

testlink 1.9.8 Win7 64位作業系統下搭建

一、安裝軟體準備

1、Apache(httpd-2.4.16-win64-VC11)

2、PHP(php-5.6.12-Win32-VC11-x64)

3、MySQL(mysql-5.6.25-winx64)

4、testlink1.9.3

二、安裝Apache

1、解壓httpd-2.2.19-win64到 C:\testlink_bugzilla\httpd-2.4.16-win64-VC11(ps:存放路徑可以自行設定)

2、在cmd命令列中進入C:\testlink_bugzilla\httpd-2.4.16-win64-VC11\Apache24\bin目錄,執行httpd -k install

cmd命令列一定要以管理員許可權開啟

3、修改C:\testlink_bugzilla\httpd-2.4.16-win64-VC11\Apache24\conf\httpd.conf

(1)   #ServerRoot "c:/Apache24"   此為註釋掉的語句
      ServerRoot "c:/testlink/httpd-2.4.16-win64-VC11/Apache24"

   路徑中使用斜槓而不是反斜槓(反斜槓會被當作轉義字元),在路徑最後不要有斜槓(即Apache24後不要有斜槓)
(2)往下找到apache開啟的功能模組:#LoadModule vhost_alias_module modules/mod_vhost_alias.so

模組後面新增:

LoadModule php5_module "C:\testlink_bugzilla\php-5.6.12-Win32-VC11-x64/php5apache2_4.dll"
PHPiniDir "c:/windows/php.ini"    
  //   php.ini   檔案在下文配置php時修改編輯,並拷貝到c:/windows/目錄下
AddType application/x-httpd-php .html .htm .php 


(3)繼續往下,找到

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.

修改DocumentRoot和Directory為:

DocumentRoot "C:/testlink_bugzilla"
<Directory "C:/testlink_bugzilla">

4、再次在命令提示符 執行 httpd -k start 沒有錯誤即伺服器啟動成功

5、IIS預設80埠,因此修改一下httpd.conf中listen埠為81,否則會出現衝突。

三、配置PHP

1、PHP目錄解壓到C:\testlink_bugzilla\php-5.6.12-Win32-VC11-x64\

2、將php.ini-development修改成php.ini

3、開啟php.ini,找到extension_dir,修改其值為C:\testlink_bugzilla\php-5.6.12-Win32-VC11-x64\ext

; On windows:
 extension_dir = "C:\testlink_bugzilla\php-5.6.12-Win32-VC11-x64\ext"

4、找到擴充套件列表,

;extension=php_gd2.dll

;extension=php_mysql.dll
;extension=php_mysqli.dll

去掉前面的“;”,即為開啟該擴充套件。

php.ini  檔案拷貝到c:/windows/目錄下

5、在C:\testlink_bugzilla\下建立一t.php檔案,內容為
           <?php
                  phpinfo();
           ?>
然後在瀏覽器位址列中輸入http://localhost:81/t.php

看到如下圖示資訊表示配置成功(注:圖中框起來的地方要格外注意 看資訊是否可以出來)

四、安裝MySQL

    MySQL資料庫在前文搭建bugzilla時已經安裝,這裡不在贅述。

   最後,在C:\testlink_bugzilla\下建立cc.php:

<?php

$link=mysql_connect("localhost","root","******root使用者的密碼******");

if(!$link) echo "link  failed ! ";

else echo "link mysql  succeed ! ";

?>


表明資料庫連線已經成功。

五、安裝testlink

1、testlink1.9.3解壓到C:\testlink_bugzilla\testlink\testlink-1.9.8下。

    安裝過程中遇到問題:

 a.點選安裝提示:


Checking if /var/testlink/logs/ directory exists [S]  Failed!
Checking if /var/testlink/upload_area/ directory exists [S]  Failed! 

解決方法:

在config.inc.php修改

$tlCfg->log_path = TL_ABS_PATH . 'logs' . DIRECTORY_SEPARATOR ;
$g_repositoryPath = TL_ABS_PATH . "upload_area" . DIRECTORY_SEPARATOR;


登入之後,有如下的警告:

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\testlink_bugzilla\testlink\testlink-1.9.8\config.inc.php on line 757

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\testlink_bugzilla\testlink\testlink-1.9.8\config.inc.php on line 1363

解決辦法:

在config.inc.php檔案前面新增
date_default_timezone_set("PRC");


在對伺服器進行修改配置時要注意幾點:

1、cmd一定要用管理員許可權開啟;

2、更改php.ini後要重啟Apache伺服器,在cmd中執行:httpd  -k  stop;    httpd  -k  start,或者httpd  -k  restart;

3、路徑中都用斜槓而不是反斜槓。

4、有時無法登入伺服器,重啟Apache伺服器即可,httpd  -k  restart;