<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>xcache &#8211; PhalconHost Blog</title>
	<atom:link href="https://blog.phalconhost.com/tag/xcache/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.phalconhost.com</link>
	<description>PhalconHost Blog</description>
	<lastBuildDate>Wed, 02 Nov 2022 06:41:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>วิธีติดตั้ง XCache 3.2.0, PHP 5.6 บน CentOS 6.8 + DirectAdmin</title>
		<link>https://blog.phalconhost.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-xcache-3-2-0-php-5-6-%e0%b8%9a%e0%b8%99-centos-6-8-directadmin/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 16 Nov 2016 00:58:59 +0000</pubDate>
				<category><![CDATA[Server, VPS]]></category>
		<category><![CDATA[xcache]]></category>
		<guid isPermaLink="false">http://blog.phalconhost.com/?p=430</guid>

					<description><![CDATA[<p>วิธีติดตั้ง XCache 3.2.0 เพื่อใช้งานร่วมกับ PHP 5.6 สามารถทำได้ง่ายๆ โดยการดาวน์โหลด source code ของ XCache และนำมา compile เอง เสร็จเรียบร้อยจะต้องได้ไฟล์ xcache.so และเปิดใช้งานใน php โดยมีขั้นตอนดังต่อไปนี้ ให้ login เข้า vps ผ่าน commandline ดูได้จากนี้ การเข้าใช้งาน ssh ผ่าน commandline ดาวน์โหลด source code ของ XCache 3.2.0 cd /opt/ wget https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz tar -xvf xcache-3.2.0.tar.gz cd xcache-3.2.0 เริ่ม compile xCache phpize ./configure --enable-xcache make make install [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.phalconhost.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-xcache-3-2-0-php-5-6-%e0%b8%9a%e0%b8%99-centos-6-8-directadmin/">วิธีติดตั้ง XCache 3.2.0, PHP 5.6 บน CentOS 6.8 + DirectAdmin</a> appeared first on <a rel="nofollow" href="https://blog.phalconhost.com">PhalconHost Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="1024" height="536" src="//i0.wp.com/blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_-1024x536.png" alt="" class="wp-image-681" srcset="https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_-1024x536.png 1024w, https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_-300x157.png 300w, https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_-768x402.png 768w, https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_.png 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>วิธีติดตั้ง XCache 3.2.0 เพื่อใช้งานร่วมกับ PHP 5.6 สามารถทำได้ง่ายๆ โดยการดาวน์โหลด source code ของ XCache และนำมา compile เอง เสร็จเรียบร้อยจะต้องได้ไฟล์ xcache.so และเปิดใช้งานใน php โดยมีขั้นตอนดังต่อไปนี้</p>



<span id="more-430"></span>



<p>ให้ login เข้า vps ผ่าน commandline ดูได้จากนี้ <a href="http://blog.phalconhost.com/ssh-access-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-linux/">การเข้าใช้งาน ssh ผ่าน commandline</a></p>



<p>ดาวน์โหลด source code ของ XCache 3.2.0</p>



<pre class="wp-block-preformatted">cd /opt/
wget https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz
tar -xvf xcache-3.2.0.tar.gz
cd xcache-3.2.0
</pre>



<p>เริ่ม compile xCache</p>



<pre class="wp-block-preformatted">phpize
./configure --enable-xcache
make
make install
</pre>



<p>เมื่อเสร็จเรียบร้อย จะแสดง path ที่เก็บไฟล์ xcache.so ไว้ที่นี่ (php แต่ละเวอร์ชั่นจะมีที่อยู่ไม่เหมือนกัน ต้องดูให้ดีว่ามันอยู่ที่ path ไหน)<br>/usr/local/lib/php/extensions/no-debug-non-zts-20131226/</p>



<p>ดูว่ามีไฟล์ xcache.so จริงหรือไม่ โดยใช้คำสั่งนี้</p>



<pre class="wp-block-preformatted">ll /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
</pre>



<p>ต่อไปให้เราเปิด xcache.so ใน php.ini แต่เราจะไม่แนะนำให้เข้าไปแก้ไขไฟล์ php.ini โดยตรง ให้ใส่ไว้ที่โฟลเดอร์ php.conf.d แทน<br>ก่อนอื่นต้องดูว่าไฟล์การตั้งค่าต่างๆของ php อยู่ที่ path ไหน โดยดูได้จากการใช้คำสั่งนี้</p>



<pre class="wp-block-preformatted">php --ini
</pre>



<p>จะเห็นว่าไฟล์ .ini จะสามารถไปวางไว้ที่ path นี้ได้ (/usr/local/lib/php.conf.d) และเราจะใส่ไฟล์ xcache.ini ไว้ในโฟลเดอร์นี้</p>



<pre class="wp-block-preformatted">vi /usr/local/lib/php.conf.d/xcache.ini
</pre>



<p>จากนั้นใส่ค่า config ต่างๆดังนี้ (เปลี่ยนค่า xcache.admin.user และ xcache.admin.pass ตามที่ต้องการ)</p>



<pre class="wp-block-preformatted">extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xcache.so
</pre>


<p>[xcache-common]</p>



<p>
;; install as zend extension (recommended), normally &#8220;$extension_dir/xcache.so&#8221;
;; this version is not a Zend Extension, but PHP module, so we do not put zend_extension parameter here.
;;extension = xcache.so

</p>


<p>[xcache.admin]</p>



<p>
xcache.admin.auth = On
xcache.admin.user = &#8220;youradminuser&#8221;
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = &#8220;youradminpass&#8221;

</p>


<p>[xcache]</p>



<p>
xcache.shm_scheme = &#8220;mmap&#8221;
xcache.size = 60M
xcache.count = 1
xcache.slots = 8K
xcache.ttl = 3600
xcache.gc_interval = 300

; Same as aboves but for variable cache
; If you don&#8217;t know for sure that you need this, you probably don’t
xcache.var_size = 4M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300

; N/A for /dev/zero
xcache.readonly_protection = Off

xcache.mmap_path = &#8220;/dev/zero&#8221;

xcache.cacher = On
xcache.stat = On

</p>



<p>เรียบร้อย ให้ restart httpd เพื่อให้ apache โหลดไฟล์ config ต่างๆ ใหม่</p>



<pre class="wp-block-preformatted">service httpd restart
</pre>



<p>ทดสอบว่า XCache เปิดการใช้งานเรียบร้อยแล้วหรือไม่</p>



<pre class="wp-block-preformatted">php -v
</pre>



<p>จะเห็นผลลัพธ์แสดงหน้าจอประมาณนี้<br><code><br>
PHP 5.6.25 (cli) (built: Sep  7 2016 22:27:45)<br>
Copyright (c) 1997-2016 The PHP Group<br>
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies<br>
    with XCache v3.2.0, Copyright (c) 2005-2014, by mOo<br>
    with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo<br>
</code></p>
<p>The post <a rel="nofollow" href="https://blog.phalconhost.com/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-xcache-3-2-0-php-5-6-%e0%b8%9a%e0%b8%99-centos-6-8-directadmin/">วิธีติดตั้ง XCache 3.2.0, PHP 5.6 บน CentOS 6.8 + DirectAdmin</a> appeared first on <a rel="nofollow" href="https://blog.phalconhost.com">PhalconHost Blog</a>.</p>
]]></content:encoded>
					
		
		
		
		<media:thumbnail url="https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_-150x150.png" />
		<media:content url="https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_.png" medium="image">
			<media:title type="html">7.cover</media:title>
			<media:thumbnail url="https://blog.phalconhost.com/wp-content/uploads/2019/03/7.cover_-150x150.png" />
		</media:content>
	</item>
	</channel>
</rss>
