18May/09Off

how to memcached session handler php

if (!$memcache = memcache_connect(MEMCACHE_SERVER, 11211)) {
ini_set('session.save_path',  '/sessions'); #your path to session directory like /tmp
} else {
ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', 'tcp://'.MEMCACHE_SERVER.':11211?persistent=1&weight=1&timeout=1&retry_interval=15');

18May/09Off

how to start memcached?

/usr/local/bin/memcached -l 127.0.0.1 -m 200 -p 11211 -u nobody &

- m 200 = 200MB

- l 127.0.0.1 = memcached server on localhost.

-l xxx.xxx.xxx.xxx = memcached server on xxx.xxx.xxx.xxx ip address, like 192.168.0.100

18May/090

colored bash prompt

.bash_profile-> export PS1="[[e[31;1m]u[e[0m]@[e[32;1m]h[e[0m]:[e[37;1m]w/[e[0m]]# [e[0m]"

user: red
host:green
dir: white,bold
[root@box:/space/]#
18May/09Off

wincachegrind

wincachegrind

wincachegrind_php_profiler

18May/09Off

The database cluster was initialized without HAVE_INT64_TIMESTAMP but the server was compiled with HAVE_INT64_TIMESTAMP.

FATAL:  database files are incompatible with server
DETAIL:  The database cluster was initialized without
HAVE_INT64_TIMESTAMP but the server was compiled with
HAVE_INT64_TIMESTAMP.
HINT:  It looks like you need to recompile or initdb.

solution: deinstall postgre, reinstall postgre without

"INTDATE Builds with 64-bit date/time type (server)"
postgresql_have_int64_timestamp

17May/091

Detect user's browser with php

php.ini = browscap = /pathto/browscap.ini

browscap.ini = http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI
script = $UserBrowserDatas = get_browser(null, true);
Tagged as: , , 1 Comment
16May/09Off

Call to undefined method MDB2_Error::execute()

Error: Call to undefined method MDB2_Error::execute()

Solution: sql query check (missing table, missing column, missing data?)

Tagged as: , , Comments Off
16May/09Off

Call to undefined method MDB2::prepare()

Call to undefined method MDB2::prepare()

Fixing solution: pear install -a -f MDB2_Driver_pgsql

lol
Tagged as: , , Comments Off