±Ù¿ø¿¡¼ Áý°èÇØ¼ ¸®´ª½º¿¡ ÀÖ´Â XCache PHP ´ÜÃà۸¦ ¼³Ä¡ÇϽʽÿÀ
XCache´Â ´ë¾È ±×·¯³ª °í¸íÇÑ eAccelerator ¹× APC (¾çÀÚÅÃÀÏ PHP ½Ã··)¿Í À¯»çÇÑ ºü¸¥ ¾ÈÁ¤µÇ¾î ÀÖ´Â PHP ´ÜÃàŰ ¹× opcode cacherÀÌ´Ù. PHPÀÇ Áý°èÇÑ bytecode (opcode ¶Ç´Â Áß°£ ºÎÈ£) ¸ð¾çÀ» ¼û±â±â ´öºÐ¿¡ XCache ¿¬Àå ÀÏÀº °¢ ÆäÀÌÁö ¿äû¿¡ PHP ¿ø½Ã Äڵ带 ºÐ¼®Çϰí Áý°èÇϱâ À§ÇÏ¿© °£Á¢ºñ¸¦ ÇÇÇϱâ À§ÇÏ¿© ´ëº»À» ¾²°í, ÀÌ·¸°Ô ¼¹ö ÁüÀ» °¨¼Ò½Ã۰í, PHP ¿øº»ÀÇ ¼º°ú¸¦ ¹Ð¾îÁÖ°í 2-10 ½Ã°£¿¡¼ PHP ºÎÈ£ÀÇ ¼Óµµ¸¦ Áõ°¡½ÃŲ´Ù.
XCache´Â PHP 4.3 PHP 4.4, PHP 5.1 ¹× cPanel¿Í Plesk¿¡ ÀÌ¿ëµÈ °øÀ¯Áö°¡ À¥ È£½ºÆÃ ¼¹öÀÇ ±âÃʸ¦ µÐ CentOS, ±×¸®°í ThreadSafe ¶Ç´Â â À¥ ¼¹ö¸¦ Æ÷ÇÔÇÏ¿© ¸®´ª½º ¼¹ö¿¡ PHP 5.2¿Í °°Àº ÃֽŠPHP cvs ºÐÁö ¸ðµÎ¸¦ Áö¿øÇÑ´Ù. XCache´Â »õ·Î¿î PHP ¹öÀüÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù¿Í °°Àº opcachers ¶Ç´Â ´ÜÃàŰ¿¡ Á¸ÀçÇÏ´Â ¸¹Àº ¹®Á¦¸¦ ±Øº¹ÇÑ´Ù. ÀÇ ¿·¿¡, ¶ÇÇÑ ÀÎ XCache ±âÁØÀ» Á¤ÇÏ´Â ´õ ºü¸£±â À§ÇÏ¿© ´Ù¸¥ opcode cachers º¸´Ù´Â.
À̰ÍÀº ¿ø½Ã ÄÚµå Æ÷Àå¿¡¼ ¼öµ¿À¸·Î Áý°èÇØ¼ XCache PHP cacher¸¦ ¼³Ä¡ÇÏ´Â ¹æ¹ý¿¡ °üÇÑ °£´ÜÇÑ ÀÚ½À¼ ±×¸®°í °¡À̵å ÀÌ´Ù. ´ç½ÅÀÌ Wordpress¸¦ »ç¿ëÇϰųª Wordpress blog ¼º°ú¸¦ °¡¼ÓÈÇÏ°í °³·®Çϱâ À§ÇÏ¿© XCache¸¦ ÀÌ¿ëÇÏ´Â °æ¿ì¿¡, ´ç½ÅÀº PHP 4°¡ ÄÚ¸àÆ® ºÎºÐ ÆäÀÌÁö ¼±Àû ¹× µîµîÀ» ¹èÄ¡Çұ⠼ö ¾ø½À´Ï´Ù¿Í °°Àº ºÒ¾ÈÁ¤¼º ¹®Á¦Á¡À» ÀÏÀ¸Å°´Â ¿øÀÎÀÌ µÇ±âÁöµµ ¸ð¸£±â ¶§¹®¿¡ ù°·Î PHP°¡ ÃֽйöÀü (PHP 5.2.1)¿¡ °Ý»óµÈ¤¤´Ù´Â °ÍÀ» º¸ÁõÇØ¾ß ÇÑ´Ù. ¾î·µç, PHP5´Â Ç×»ó ¸¸ÀÏ °¡´ÉÇÏ´Ù¸é ÃßõµÈ´Ù. ±×¸®°í ¸ðµç PHP ´ÜÃàŰ·Î °Í°ú °°ÀÌ, XCache´Â PHP suEXEC¸¦ ÄÒ´Ù »ç¿ëÇÏÁö ¾ÊÀ» °ÍÀÌ´Ù. PHP suEXEC´Â Á¦´ë·Î ÀÛµ¿Çϱâ À§ÇÏ¿© XCache¸¦ À§ÇØ ¹«´ÉÇØ¾ß ÇÑ´Ù.
ÇöÀç, XCache´Â 2°³ ºÐÁö¸¦, i.e À¯ÁöÇÑ´Ù. ¹öÀü 1.0.3¿Í ¹öÀü 1.2.0. ¹öÀüÀº µÑ ´Ù Áö±Ý PHP 4.3.x¿Í 4.4.x¸¦ À§ÇØ, ±×¸®°í PHP 5.0.x ½Ã¸®Á Á¦¿ÜÇϰí 5.1.x ±×¸®°í 5.2.x¸¦ Æ÷ÇÔÇÏ¿© PHPÀÇ ÃÖ´ë ¹öÀüÀ» À§ÇØ ÃßõµÈ, ¹öÀü 1.0.x°¡ ¾ÈÁ¤µÇ¾î ÀÖ´Â ¹æÃâ, ÃßõµÈ ¹öÀü 1.2.xÀÌ´Ù. ´ç½ÅÀÌ PHP4¸¦ »ç¿ëÇÏ´Â °æ¿ì¿¡, µÎ ´ç½ÅÀÇ ½ÅûÀ» À§ÇØ °¡Àå Àû´çÇÑ °ÍÀ» ¾¥½Ã´Â XCacheÀÇ ¹öÀüÀ» ½ÃµµÇϽʽÿÀ. ´ç½ÅÀÌ usinng ¼³Ä¡ÇÏ´ÂÁö PHPÀÇ ¾î´À ¹öÀüÀ̶ó°íÀ̰ųª, ¸í·É php¸¦ - v°¡ ¹ßÇàÇϰųª µÚ¿¡ ¿À´Â ³»¿ëÀ» °¡Áø PHP ÆÄÀÏÀ» °Ë»çÇϱâ À§ÇÏ¿©´Â, ±× ÈÄ¿¡ À¥ ºê¶ó¿ìÀú¿¡¼ ÆÄÀÏÀ» ºÎ¸£½Ê½Ã¿À:
<? php
phpinfo ();
?>
- »ç¿ëÀÚ ¸í·É ´ÙÀ½ ¸¦ »ç¿ëÇÏ´Â /usr/local/src¿Í °°Àº ÇöÁö ¿ø½Ã µð·ºÅ丮¿¡ º¯È:
CD /usr/local/src
- ´ç½ÅÀÌ ÀÓ¸í¿¡ ¼±ÅÃÇÏ´Â XCacheÀÇ ¹öÀüÀÇ ±Ù¿ø Æ÷ÀåÀ» ¸¸È¸ÇÏ°í ´Ù¿î·ÎµåÇϽʽÿÀ.
wget http://210.51.190.228/pub/XCache/Releases/xcache-1.0.3.tar.gz (XCache 1.0.3¸¦ À§ÇØ)
¶Ç´Â
wget http://210.51.190.228/pub/XCache/Releases/xcache-1.2.0.tar.gz (XCache 1.2.0¸¦ À§ÇØ)
- Untar´Â, µÚ¿¡ ¿À´Â ¸í·ÉÀÇ ÇÑÀ» °¡Áø ±â·Ï º¸°ü¼Ò¸¦ ÁöÆÛ¸¦ ¿°Å³ª, Ç®°Å³ª ÃßÃâÇÑ´Ù:
Ÿ¸£ - zxf xcache-*.tar.gz
gzip - dc xcache-*.tar.gz | Ÿ¸£ - x - ±Ù¿ø ³»¿ëÀ» °¡Áø xcache ÀüȹøÈ£ºÎ·Î µé¾î°¡½Ê½Ã¿À:
cd xcache
- Trigger PHP building environment:
phpize
- Optional but recommended practice is to build XCache outside of source directory:
mkdir ../xcache-build
cd ../xcache-build - Run the configure with the option that you want, the basic is as below which will enable the XCache by default:
../xcache/configure –enable-xcache
You can list out all available options by using ../xcache/configure –help command, which will display the following:
–enable-xcache Include XCACHE support.
–enable-xcache-optimizer XCACHE: (N/A)
–enable-xcache-coverager XCACHE: Enable code coverage dumper
–enable-xcache-assembler XCACHE: (N/A)
–enable-xcache-disassembler XCACHE: Enable opcode to php variable dumper
–enable-xcache-encoder XCACHE: (N/A)
–enable-xcache-decoder XCACHE: (N/A)
–enable-xcache-test XCACHE: Enable self test - FOR DEVELOPERS ONLY!! - Compile the source with following command:
make
Ensure that no error occurred.
- If you haven¡¯t already using root account, su to root user.
- Install XCache binary with the following command:
make install
Ensure that no error occurred, and note down the extension installation path of the xcache.so.
- Next, XCache need to be configured and enabled in PHP.INI file. Locate the correct location of php.ini configuration file by using phpinfo() function (see sample listed above to check version of PHP). In web hosting environment, normally it¡¯s located in /etc or /usr/local/lib. If the install of PHP parses the /etc/php.d/ folder, then simply create a file in that folder named ¡°xcache.ini¡± or copy over the sample xcache.ini came with source package.
Change back to xcache source unpack directory, and run the following command with root user:
cat xcache.ini >> /etc/php.ini
$EDITOR /etc/php.iniNote: change to the path of php.ini accordingly
This will append the default XCache configuration to the end of php.ini. Alternatively, you can copy and paste the following text into the php.ini file yourself too:
[xcache-common]
;; install as zend extension (recommended)
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-xxx/xcache.so
;; install as zend extension with thread-safe
; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
;; install as PHP extension (extension_dir must be set to the full path to xcache.so)
; extension = xcache.so[xcache.admin]
xcache.admin.user = ¡°admin¡±
xcache.admin.pass = md5($your_password)[xcache]
xcache.shm_scheme = ¡°mmap¡±
xcache.size = 16M
xcache.count = 1
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0xcache.var_size = 0M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = ¡°/dev/zero¡±
xcache.coredump_directory = ¡°¡±
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = ¡°¡±
- You can configure XCache to your preference. One setting that must be changed is under the [xcache-common], where you must specify the correct installation path of the XCache extension module. You can also opt to run XCache as PHP extension instead of extension for Zend module. In this case, comment and uncomment the line accordingly. Other important options include ¡°xcache.size¡± which specify amount the memory allocated to XCache, ¡°xcache.count¡± to take advantage of multi-core processors or multiple processors. And if you plan to use XCache web administration interface, input the ¡°xcache.admin.user¡± and md5 checksum value of ¡°xcache.admin.pass¡±. Try MD5 tools to generate the correct value, or use the following command to generate the MD5 for your password:
echo -n ¡°password¡± | md5sum
Note: Explanation and definition of all XCache INI settings can be found here.
- Restart the Apache httpd web server. The following commands should work:
/etc/init.d/apache* restart
or
/etc/init.d/httpd* restart
- Ensure the XCache is running by calling PHP file with phpinfo() (see sample above). You should see a new XCache Support block with opcode cache enabled.
- If you wish to set up XCache administration page, configure an alias in httpd.conf of Apache to point to the admin subdirectory within XCache. To do so, add the following line to httpd.conf (assuming your xcache source is extracted at /usr/local/src/, and you want to access admin page from /xcache-admin/ URL):
Alias /xcache-admin/ /usr/local/src/xcache/admin/
Then restart Apache web server. For lighttpd, add the following line instead:
alias.url += (¡±/xcache-admin/¡± => ¡°/usr/share/xcache/admin/¡±)
Alternatively, you can also copy the whole ¡°admin¡± directory from the ¡°xcache¡± source folder to web document-root or sub-directory of your domain which is web accessible. However, this method is not recommended as you may forget to update the admin page when XCache package is updated.
Note: Ensure that open_basedir protection, if enabled, is excluded for the directory contains admin-page.
IMPORTANT: This is a machine translated page which is provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Proper Way to Generate MD5 Hash for XCache Administration Password with md5sum or PHP
- Run WordPress at Top Fast Speed by Putting Objects and Variables into XCache or eAccelerator Cache Memory (Plugin)
- Running Google Earth on Suse Linux with VMware
- Cheapest Linux Box Ever
- Get Ready for Linux Genuine Advantage (LGA) - with Source and Crack
- Novell SUSE Linux Enterprise Server 10 Reviews
- Enable Gzip Compress on Wordpress with WP-Cache 2.x
- How to Open and View or Extract CHM (Compiled HTML) Files in Linux
- Easily Set Up Web Server with XAMPP
- Free Download Manager 2.5 Build 708 Released
























