How to install Xcache to accelerate php in linux step by step.

Source: Internet
Author: User

How to install Xcache to accelerate php in linux step by step.
First of all, I strongly spoke about it. The tutorials on Baidu were all copied on the left and right. They were in a mess and were missing from the East and the West. In this case, I will provide my painstaking tutorials. So that you can use Xcache to accelerate php smoothly. If you have finished the operation and still fail, please contact QQ 496928838, slightly cooler, I also want to see how you can't install it step by step.


Slightly cooler and original data, reprinted, beg you to keep my information.


# Step 1: Download Xcache

wget http://xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz


# The first step is very simple. If you cannot download it, it is a matter of character.


# Step 2: Decompress the Xcache source code.
tar -zvxf xcache-3.1.0.tar.gz

# The second part is also very simple. If you cannot decompress it, it is a matter of character.


# Next, by the way, go to the installation directory
cd xcache-3.1.0


# Step 3: it is very important that the basic errors are all here.
# First, run the phpize configuration before installation.
/Php path/bin/phpize
# Ensure that php is installed. If php is not installed, install php first. (You don't need to install php or Xcache)


# Next, configure-> compile-> install in one step, provided that your path is correct.
# Configuration. /configure -- prefix =/php path/lib/php/extensions \ -- with-php-config =/php path/bin/php-config \ -- enable-xcache # compile make # install make install


# After the installation is complete, something similar to the following will appear to prove that the installation is successful.
/Www/php/extensions/no-debug-non-zts-20060613/


# Here, even if the installation is complete, the remaining part is the configuration work.




# Move the xcache Management page to the web directory.
cp ./htdocs /www/web/xcache -r

#./Htdocs, which is in the source code directory. Don't tell me you can't find it.
#/Www/web/xcache, web directory, and its name is what you like.
# Of course, if you are stupid. This command cannot be used. Then, in the decompressed source code directory, it is OK to directly move through tools such as FTP.


Configure php. ini,
Find xcache. ini in the source code directory and add it directly after php. ini.
# Use the following command to append the configuration file xcache. ini to php. ini.
Cat xcache. ini>/php path/etc/php. ini


# If you are stupid, it is recommended to operate in FTP, because the user name and password to be managed must be modified later...


Modify the properties in xcache. ini. After executing the above command, you need to edit php. ini.
Xcache. admin. user = "admin"
Xcache. admin. pass = "21232f297a57a5a743894a0e4a801fc3"
The password is admin. If you want to change the password or something, you can understand it with your talents.
Xcache. mmap_path = "/tmp/xcache"
# It is recommended that the file be In the tmp directory. Remember to grant the 777 permission.
touch /tmp/xcachechmod 777 /tmp/xcache




Note the above.
The following figure shows the configured xcache. ini and I will remove the comments.
Please take a look at the http://xcache.lighttpd.net/wiki/XcacheIni to annotate...
[xcache-common]extension = xcache.so[xcache.admin]xcache.admin.enable_auth = Onxcache.admin.user = "admin"xcache.admin.pass = "21232f297a57a5a743894a0e4a801fc3"[xcache]xcache.shm_scheme =        "mmap"xcache.size  =               128Mxcache.count =                 1xcache.slots =                8Kxcache.ttl   =                 0xcache.gc_interval =           0xcache.var_size  =            4Mxcache.var_count =             1xcache.var_slots =            8Kxcache.var_ttl   =             0xcache.var_maxttl   =          0xcache.var_gc_interval =     300xcache.var_namespace_mode =    0xcache.var_namespace =        ""xcache.readonly_protection = Offxcache.mmap_path =    "/tmp/xcache"xcache.coredump_directory =   ""xcache.coredump_type =         0xcache.disable_on_crash =    Offxcache.experimental =        Offxcache.cacher =               Onxcache.stat   =               Onxcache.optimizer =           Off[xcache.coverager]xcache.coverager =           Offxcache.coverager_autostart =  Onxcache.coveragedump_directory = ""






Restart the server, which is so simple that the server can be installed without accident.
service httpd restart




Check whether Xcache exists in phpinfo. If yes, the installation is successful.


If the configuration is complete, the page cannot be opened. It proves that your php. ini conflicts.


For example, zend optimizer, this item will conflict. The solution is to change zend_extension to the cache file defined by Xcache.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.