Server-Side/PHP2010. 10. 14. 11:02
1. memcahced 를 Download 한다.


2. memcached 를  install 한다.

c:\memcached 에 압축을 풀고 command line(cmd)으로 간다.

c:\> cd c:\memcached
c:\> memcached.exe -d install
c:\> memcached.exe -d start
c:\> netstat -a
.
.
TCP     junp:11211     junp:0     LISTENING
.
.

3. php extension을 Download 한다. pecl-5.2.6-Win32.zip
압축풀면 php_memcache.dll 이 있으므로 extension_dir 에 복사를 하고
php.ini에 extension=php_memcache.dll 을 추가한다.


Posted by 준피
Server-Side/PHP2010. 10. 12. 21:44
$pattern = '/([\xEA-\xED][\x80-\xBF]{2}|[a-zA-Z0-9])+/';
$str = 'abc!@하나둘셋#123';
echo $str;
preg_match_all($pattern, $str, $match);
$str = implode('', $match[0]);
echo $str;
==================
abc!@하나둘셋#123
abc하나둘셋123

한글과 영어 숫자를 제외한 나머지문자는 무시하게 된다.




Posted by 준피
Server-Side/Linux2010. 10. 11. 18:00
# wget http://pecl.php.net/get/memcache-2.2.4.tgz
# tar xzfv memcache-2.2.4.tgz
# cd memcache-2.2.4
# phpize
# ./configure --enable-memcache
# make
# cp modules/*.* /usr/lib64/extensions/no-debug-non-zts-20060613/
# vi /usr/local/apache/conf/php.ini

extension=memcache.so

mongo 설치하는거때문에 신경 많이 쓰였는데 의외로 쉽게 설치가 되었군요.

Posted by 준피
Server-Side/Linux2010. 10. 9. 14:53
1. 현재 설치된 버전 확인
# rpm -qa |grep php
 php-common-5.1.6-15.el5.i386
 php-cli-5.1.6-15.el5.i386
 php-5.1.6-15.el5.i386
 php-pdo-5.1.6-15.el5.i386
 php-bcmath-5.1.6-15.el5.i386
 php-ldap-5.1.6-15.el5.i386
 php-devel-5.1.6-15.el5.i386
 php-gd-5.1.6-15.el5.i386
 php-xml-5.1.6-15.el5.i386
 php-mbstring-5.1.6-15.el5.i386
 php-mysql-5.1.6-15.el5.i386
 php-dba-5.1.6-15.el5.i386
2. update 하기 위해 파일 생성
# vi /etc/yum.repos.d/CentOS-Testing.repo
--------------------------------------------------------------------------
# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*
--------------------------------------------------------------------------
3. 업데이트 하기
 # rpm -qa |grep php
 # yum update
 # service httpd restart


Posted by 준피
Server-Side/Linux2010. 10. 9. 14:17
CentOS 64bit, php-5.2.5에서 mysqli를 설치해봤다.
apm 설치할때 보니까 mysqli가 빠져있길래 추가로 설치를 해봤다.
예전에는 애좀 먹었는데 간만에 하니까 술술 잘되는구나

# cd /usr/local/src/apm/php-5.2.5/ext/mysqli
# phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config
# make

# mkdir -p /usr/lib64/extension/no-debug-non-zts-20060613
# cp modules/*.* /usr/lib64/extension/no-debug-non-zts-20060613/
# vi /usr/local/apache/conf/php.ini

extension_dir = "/usr/lib64/extensions/no-debug-non-zts-20060613/"
.
.
.
extension=mysqli.so

# /etc/init.d/http restart


'Server-Side > Linux' 카테고리의 다른 글

[CentOS] php에서 memcache 설치하기  (0) 2010.10.11
[CentOS] php version update 5.1 to 5.2  (0) 2010.10.09
[CentOS] 아파치 2개 이상 설치한 경우 해결책  (0) 2010.09.20
netstat 사용법  (0) 2010.09.20
서버 상태 확인  (0) 2010.08.28
Posted by 준피