在PHP開發階段使用到phpmyadmin, 常會發生過一段時間後, phpmyadmin timeout了, 又要重新登入一次, 實在是很麻煩, 所以調高timeout時間, 較為方便, 做法如下:
修改config.inc.php
$cfg['LoginCookieValidity'] = 7200; // In seconds
2010年10月16日 星期六
2010年10月15日 星期五
[PEAR] Windows使用PHP安裝PEAR遇到failed to open stream: phar error
C:\php>go-pear.bat
在Windows上使用PHP安裝PEAR時遇到錯誤
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C:\php\PEAR\go-pear.phar on line 1236
解決方法:
修改php.ini
找到
;phar.require_hash = On
改成
phar.require_hash = Off
再安裝一次
C:\php>go-pear.bat
就可以跑了~
在Windows上使用PHP安裝PEAR時遇到錯誤
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C:\php\PEAR\go-pear.phar on line 1236
解決方法:
修改php.ini
找到
;phar.require_hash = On
改成
phar.require_hash = Off
再安裝一次
C:\php>go-pear.bat
就可以跑了~
[Python] Calculate execution time 計算程式執行時間
'''
Created on 2010/10/15
@author: Hank Wang
'''
import time, itertools
# 記錄開始時間 Record start time
tStart = time.time()
# 跑一個permutation
for item in (itertools.permutations("0123456789", 6)):
print(''.join(item))
# 記錄結束時間 Record stop time
tStop = time.time()
print(tStop - tStart)
2010年10月13日 星期三
[CentOS] 設定TimeZone 與 Date更改時間
調整 CentOS 的 Time Zone
修改以下檔案變更Timezone
ZONE="Asia/Taipei"
# MMDDhhmmYYYY 月日時分年
# 查看 BIOS 時間
# 將系統時間寫入到 BIOS 時間
$ cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime修改以下檔案變更Timezone
$ vim /etc/sysconfig/clockZONE="Asia/Taipei"
# MMDDhhmmYYYY 月日時分年
$ date 101322202010# 查看 BIOS 時間
$ hwclock -r# 將系統時間寫入到 BIOS 時間
$ hwclock -w
2010年10月12日 星期二
[Moodle] 修正Moodle 1.9.9無法在某些瀏覽器正常使用HTML Editor
修正方法需些改兩個檔案~ 分別如下:
/lib/moodlelib.php
/lib/editor/htmlarea/htmlarea.php
It Works!
Reference:
Making Moodle work better on #Chrome browser
http://moodle.org/mod/data/view.php?d=13&rid=3945
/lib/moodlelib.php
line 6519 } else {
line 6520 return 1;
line 6521 }
/lib/editor/htmlarea/htmlarea.php
line 2408 //alert("Mozilla < 1.3 Beta is not supported!\n" +
line 2409 // "I'll try though, but it might not work.");
line 2410 return 'HTMLArea.is_gecko';
line 2414 //return false;
line 2415 return 'HTMLArea.is_gecko';It Works!
Reference:
Making Moodle work better on #Chrome browser
http://moodle.org/mod/data/view.php?d=13&rid=3945
訂閱:
文章 (Atom)