Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to manually install eAccelerator and XCache for LiteSpeed

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to manually install eAccelerator and XCache for LiteSpeed", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to manually install eAccelerator and XCache for LiteSpeed" this article.

In fact, LiteSpeed has these two components when compiling PHP, but why do micro-demons install them manually? The reason is that problems such as unparsing often occur after the official two components are checked. This problem seems to have nothing to do with the specific VPS you use, but has something to do with the frequent fuss of the official website link. Therefore, in order to avoid getting stuck in the first step of Compile PHP, you can temporarily cancel these two components, as in this article, manually install ~

No matter which one is installed, make sure that / usr/local/lsws/lsphp5/lib/php.ini exists first, and if not, execute the following command

Cp / usr/local/lsws/php/php.ini / usr/local/lsws/lsphp5/lib/

No matter which one you choose to install, please restart Graceful Restart in the LiteSpeed panel to take effect.

Install eAccelerator

1. Install the necessary dependent files (in many cases, this step is superfluous, but to avoid mistakes, do it)

In this article, I will take Debian as an example. As for CentOS, apt-get can be replaced with yum in this article, which is basically universal.

Apt-get install autoconf automake libtool m42. Install eAccelerator

You can go to the official website to find the latest download link and replace the url below (go to the official website download page)

The code is as follows:

Cd ~

Wget https://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-0.9.6.1.tar.bz2

Tar jxvf eaccelerator-0.9.6.1.tar.bz2

Cd eaccelerator-0.9.6.1

/ usr/local/lsws/lsphp5/bin/phpize

. / configure-enable-eaccelerator=shared-with-php-config=/usr/local/lsws/lsphp5/bin/php-config

Make

Make install

If you compile PHP 5.4 in LiteSpeed by default, the following error may occur during make, which may be caused by the incompatibility of the new version. Either modify XCache or replace it with PHP 5.3.

The code is as follows:

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c: In function 'eaccelerator_restore':

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c:878: warning: assignment discards qualifiers from pointer target type

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c: In function 'eaccelerator_compile_file':

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c:1317: error: 'zend_class_entry' has no member named' line_start'

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c: At top level:

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c:1913: error: expected'=',';', 'asm' or' _ _ attribute__' before 'eaccelerator_functions'

/ home/package/eaccelerator-0.9.6.1/eaccelerator.c:1938: error: 'eaccelerator_functions' undeclared here (not in a function)

Make: * * [eaccelerator.lo] Error

13. Configure eAccelerator to take effect (this part was discussed in the previous article, so I won't say much here)

The code is as follows:

Mkdir / usr/local/eaccelerator_cache

Chmod-R 777 / usr/local/eaccelerator_cache

Vi / usr/local/lsws/lsphp5/lib/php.ini

Add the following fields at the end of the php.ini file

The code is as follows:

[eaccelerator]

Zend_extension= "/ usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so"

Eaccelerator.shm_size= "1"

Eaccelerator.cache_dir= "/ usr/local/eaccelerator_cache"

Eaccelerator.enable= "1"

Eaccelerator.optimizer= "1"

Eaccelerator.check_mtime= "1"

Eaccelerator.debug= "0"

Eaccelerator.filter= ""

Eaccelerator.shm_max= "0"

Eaccelerator.shm_ttl= "3600"

Eaccelerator.shm_prune_period= "3600"

Eaccelerator.shm_only= "0"

Eaccelerator.compress= "1"

Eaccelerator.compress_level= "9"

Eaccelerator.keys = "disk_only"

Eaccelerator.sessions = "disk_only"

Eaccelerator.content = "disk_only"

Check whether the php.ini file is normal

The code is as follows:

/ usr/local/lsws/lsphp5/bin/php-v

If there is no accident, there should be no wrong report.

Install XCache

1. Install Xcache (check the latest version of the official website)

The code is as follows:

Cd ~

Wget http://xcache.lighttpd.net/pub/Releases/3.0.0/xcache-3.0.0.tar.gz

Tar zxvf xcache-3.0.0.tar.gz

Cd xcache-3.0.0

/ usr/local/lsws/lsphp5/bin/phpize

. / configure-enable-xcache-with-php-config=/usr/local/lsws/lsphp5/bin/php-config

Make

Make install

After make install, you will give a directory and write it down for backup. Depending on the version of litespeed, it seems that the name of this directory is also different. Mine is / usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/.

two。 Modify the php.ini file

The code is as follows:

Vi / usr/local/lsws/lsphp5/lib/php.ini

Add the following at the end

The code is as follows:

Extension_dir = "/ usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/"

Extension= "xcache.so"

[xcache-common]

;; install as zend extension (recommended), normally "$extension_dir/xcache.so"

;; or install as extension, make sure your extension_dir setting is correct

; extension = xcache.so

[xcache.admin]

Xcache.admin.auth = On

Xcache.admin.user = "mOo"

; xcache.admin.pass = md5 ($your_password)

Xcache.admin.pass =

[xcache]

Xcache.shm_scheme = "mmap"

Xcache.size = 32m

Xcache.count = 1

Xcache.slots = 8K

Xcache.ttl = 3600

Xcache.gc_interval = 300

; Same as aboves but for variable cache

; If you don't know for sure that you need this, you probably don't

Xcache.var_size = 0m

Xcache.var_count = 1

Xcache.var_slots = 8K

Xcache.var_ttl = 0

Xcache.var_maxttl = 0

Xcache.var_gc_interval = 300

; NCMA for / dev/zero

Xcache.readonly_protection = Off

Xcache.mmap_path = "/ dev/zero"

Xcache.cacher = On

Xcache.stat = On

The password field xcache.admin.pass can be customized. Use md5 to encrypt the password you want, such as

Echo-n "vmvps" | md5sum

3. Verify that php.ini is in error

/ usr/local/lsws/lsphp5/bin/php-v

If the following error occurs

PHP Fatal error: Directive 'allow_call_time_pass_reference' is no longer available in PHP in Unknown on line 0 can be solved with the following command

Perl-pi-e's / ^ allow _ call_time_pass_reference/;allow_call_time_pass_reference/' / usr/local/lsws/lsphp5/lib/php.ini

The above is all the contents of the article "how to manually install eAccelerator and XCache for LiteSpeed". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report