??
php5-memcached比php5-memcache速度略快一點
php5-memcached和php5-memcache是兩個php操作memcached的組件,他們是不同人開發的。
php官網都列出了他們各自的使用方法:
,先安裝下apache:
sudo apt-get updatesudo apt-get install apache2
2. 然後安裝下php5: 5p
3. 接著安裝memcached:
sudo apt-get install memcached
4. 接著安裝5-mep -memcache
sudo apt-get install php5-memcached
5. 最後重啟下apache2:
sudo service apache2 restart Otest
sudo service apache2 restarttest. . 運行
http://machinename/test.php或php /var/www/html/test.php
root@machinename
# php /var/www/html/test@machinename# php /var/www/html/test.php. : 10000 keysmemcached set: 0.7015380859375memcached get: 0.61220598220825memcache set: 0.78830289840698384069
~root@machinename
# php /var/www/html/test2.php
memcache vs memcached: 10000 keys
memcache set: 0.78771591186523
memcache get: 0.75219798088074memcached set: 0.69968199789819798970797039703039703973039703030 281
參考文件:1.https://www.digitalocean.com/community/tutorials/ how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu 2. https://www.digitalocean.com/community/tutorials/how-to-install-and-use-memcache -on-ubuntu-14-04
3. https://www.leaseweb.com/labs/2013/03/memcache-vs-memcached-php-benchmark/
以上就介紹了php5-memcached比php5-memcache速度略快一點,包含了方面的內容,希望對PHP教程有興趣的朋友有所幫助。