Help - Search - Members - Calendar
Full Version: HOW-TO: Install Eaccelerator (Turck MMCache replacement)
The Planet Forums > System Administration > Web Hosting
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Erwin
Updated to Eaccelerator 0.9.3 Final Release

Eaccelerator is a further development from mmcache PHP Accelerator & Encoder. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated.

The instructions in this How-To is a bit different to the official one, because the directories are a bit different - I couldn't get this to work using the instructions from the official guide itself. I also point to the module file in a different directory in php.ini - the default one in the official instructions didn't work for me.

NOTE: I couldn't get mmcache to work with PHP 4.3.11 as well. eaccelerator works.

Follow the instructions to install or to upgrade from mmcache.


Installation:

UPGRADING:

1) To upgrade eaccelerator:

Just download the NEW version of eaccelerator and recompile - same instructions as installating.

NOTE the CHANGES to the directory path in php.ini

2) To upgrade PHP versions:

You need to DELETE the eaccelerator directory that has been compiled, re-untar the eaccelerator gzip file and RE-INSTALL and recompile eaccelerator for every NEW version of PHP.

1) Login as root in SSH

2) Run the following commands in the following order:

cd /

mkdir ea

cd ea

wget http://kent.dl.sourceforge.net/sourceforge...or-0.9.3.tar.gz


tar xvzf eaccelerator-0.9.3.tar.gz

cd eaccelerator-0.9.3

export PHP_PREFIX="/usr"

$PHP_PREFIX/bin/phpize

./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config

make

make install

3) Edit php.ini - usually it's /etc/php.ini or /usr/local/lib/php.ini

Find this:

;Windows Extensions

Above this, comment out or remove the PHPA or mmcache lines if you have them. Replace them with this:

To install as a ZEND extension:

zend_extension="/ea/eaccelerator-0.9.3/modules/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

OR to install as a PHP extension:

extension="/ea/eaccelerator-0.9.3/modules/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

4) Create the cache directory by doing the following at the command line

mkdir /tmp/eaccelerator

chmod 0777 /tmp/eaccelerator


5) Restart Apache

service httpd restart

Done!

6) Optional - upload ea.php file

I modified the eaccelerator.php file so that only you can control the eaccelerator config and see the stats.

Edit ea.php - change 1 to your userid.

Upload to your forum directory.

When you link to ea.php you can see your eaccelerator stats like this:

eAccelerator 0.9.3

eAccelerator support enabled
Caching Enabled true
Optimizer Enabled true
Memory Size 33,554,396 Bytes
Memory Available 22,675,372 Bytes
Memory Allocated 10,879,024 Bytes
Cached Scripts 101
Removed Scripts 0
Cached Keys 0

Enjoy! icon_smile.gif
Ronny
Has anyone used thsi with success over phpa?
levovich
Erwin, thanks a lot for the great how-to.

I have just installed mmcache. PHP scripts actually appear to work faster than they used to. cool.gif I'm surprised the speed increase is noticeable. However, can somebody provide a way to check the speed difference in numbers? I trust numbers more than my "gut feelings". icon_biggrin.gif
Proetorian
I have been using mmcache from TurckSoft for about 45 days in a php-heavy dynamic environment. There is a noticeable performance boost due to the optimized php caching.

I prefer mmcache over Zend Accelerator, phpa and After Burner because (1) it offers excellent caching performance, second best to Zend's but without the additional cost; (2) it is not intrusive as phpa can be; and (3) it is highly customizable for process optimization.

You can see my post and some of the feedback received in this thread:

http://forums.rackshack.net/showthread.php...?threadid=19188
rgesnot
Hello,

I have some problem when I execute phpize

I have this result
[PHP][root@srv01 turck-mmcache-2.3.10]# phpize
aclocal: macro `AC_ADD_LIBPATH' defined in acinclude.m4 but never used
aclocal: macro `AC_ADD_LIBRARY_WITH_PATH' defined in acinclude.m4 but never used
aclocal: macro `AC_ADD_LIBRARY' defined in acinclude.m4 but never used
aclocal: macro `AC_ADD_INCLUDE' defined in acinclude.m4 but never used
You should update your `aclocal.m4' by running aclocal.[/PHP]

I think there is the problem when aclocal version and autoconf version aren't compatible.

[PHP]aclocal --version[/PHP] return :

[PHP]aclocal (GNU automake) 1.4-p5

Copyright © 1999, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Written by Tom Tromey [/PHP]

and

[PHP]autoconf --version[/PHP] return :

[PHP]Autoconf version 2.13[/PHP]

Could you help me ?

Thanks
levovich
I had the same problem on my Ensim server; however, no such problem on Plesk. I thought it did not mean much; however, I would also like to hear any possible solution to it. icon_smile.gif
ronan675
I am having a strange problem when I try to install this on my Plesk box. When I run phpize I get command not found.

Locate phpize shows

/usr/local/src/php-4.2.2/pear/scripts/phpize.in
/usr/local/src/php-4.2.2/pear/scripts/phpize

When I run it from that location in the mmcache directory I get
.
/usr/local/src/php-4.2.2/pear/scripts/phpize: cd: /usr/local/psa/apache/lib/php/build: No such file or directory
/usr/local/src/php-4.2.2/pear/scripts/phpize: cd: /usr/local/psa/apache/lib/php/build: No such file or directory
mv: cannot stat `build/rules_pear.mk': No such file or directory
/usr/local/src/php-4.2.2/pear/scripts/phpize: /usr/local/psa/apache/lib/php/build/pear.m4: No such file or directory
aclocal: `configure.ac' or `configure.in' is required
autoconf: configure.in: No such file or directory
/usr/bin/m4: configure.in: No such file or directory
libtoolize: `configure.ac' does not exist
Try `libtoolize --help' for more information.

Any ideas are greatly appreciated. I really want to install this.
aventure
QUOTE
Originally posted by Erwin

Find this:

;Windows Extensions

Above this, comment out the PHPA or ZEND lines if you have them. You cannot run this and PHPA or ZEND together. Replace them with this:

zend_extension="/mmcache/turck-mmcache-2.3.10/modules/mmcache.so"


Replace
QUOTE
zend_extension="/mmcache/turck-mmcache-2.3.10/modules/mmcache.so"


With
QUOTE
zend_extension="/root/mmcache/turck-mmcache-2.3.10/modules/mmcache.so"



Otherwise it will not find and load the module.
This was on an Ensim box.

PHPsize also did not work, but it is installed.
aventure
Anyone that has installed it, can you post up your following?
(from phpinfo)

QUOTE
Memory Size 16,777,216 Bytes  
Memory Available 14,177,416 Bytes  
Memory Allocated 2,599,800 Bytes  
aventure
Can't say I've noticed much change unfortunately with the installation of it..
levovich
Here is the information from my Plesk server.

QUOTE
Caching Enabled true  
Optimizer Enabled true  
Memory Size 16,777,216 Bytes  
Memory Available 8,867,464 Bytes  
Memory Allocated 7,909,752 Bytes  
Cached Scripts 166  
Removed Scripts 0  
Cached Keys 0


Here is the information from my Ensim server.

QUOTE
Caching Enabled true  
Optimizer Enabled true  
Memory Size 16,777,216 Bytes  
Memory Available 664 Bytes  
Memory Allocated 16,776,552 Bytes  
Cached Scripts 559  
Removed Scripts 0  
Cached Keys 0
rgesnot
Hello,

3 minutes after

QUOTE
Memory Size 16,777,216 Bytes  
Memory Available 10,321,456 Bytes  
Memory Allocated 6,455,760 Bytes  
Cached Scripts 168  
Proetorian
QUOTE
Originally posted by ronan675
I am having a strange problem when I try to install this on my Plesk box. When I run phpize I get command not found.

Locate phpize shows

/usr/local/src/php-4.2.2/pear/scripts/phpize.in
/usr/local/src/php-4.2.2/pear/scripts/phpize

When I run it from that location in the mmcache directory I get
.
/usr/local/src/php-4.2.2/pear/scripts/phpize: cd: /usr/local/psa/apache/lib/php/build: No such file or directory
/usr/local/src/php-4.2.2/pear/scripts/phpize: cd: /usr/local/psa/apache/lib/php/build: No such file or directory
mv: cannot stat `build/rules_pear.mk': No such file or directory
/usr/local/src/php-4.2.2/pear/scripts/phpize: /usr/local/psa/apache/lib/php/build/pear.m4: No such file or directory
aclocal: `configure.ac' or `configure.in' is required
autoconf: configure.in: No such file or directory
/usr/bin/m4: configure.in: No such file or directory
libtoolize: `configure.ac' does not exist
Try `libtoolize --help' for more information.

Any ideas are greatly appreciated. I really want to install this.


I believe you need to update your php to 4.3.1. It appears that you are running version 4.2.2.
Proetorian
Turck MMCache version 2.3.11 was released today. It fixes the following issues with release 2.3.10:

- PHP crash on some platforms when loading encoded files was fixed
- performence was improved by using indoes instead of realnames
- performence was improved by using low level spinlocks on x86
- 64-bit processor compatibility fixes
- encoder memory leaks were fixed

You can get it at Sourceforge -

For tar.gz at:

http://easynews.dl.sourceforge.net/sourcef...e-2.3.11.tar.gz

Finally, I checked and verified that versions 2.3.10 and up require php 4.3.1.
byronm
Is this compatible with Ion-Cube encoded or Zend-Encoded pages?


phpa is Ion-Cube supported, and Zend is well, expensive and the free one doesn't do squat but let you run encoded files.
aventure
QUOTE
Originally posted by Proetorian
Turck MMCache version 2.3.11 was released today.  It fixes the following issues with release 2.3.10:

- PHP crash on some platforms when loading encoded files was fixed
- performence was improved by using indoes instead of realnames
- performence was improved by using low level spinlocks on x86
- 64-bit processor compatibility fixes
- encoder memory leaks were fixed  

You can get it at Sourceforge -

For tar.gz at:

http://easynews.dl.sourceforge.net/sourcef...e-2.3.11.tar.gz  

Finally, I checked and verified that versions 2.3.10 and up require php 4.3.1.


I am and have been using this on 4.2.2 without any issues.
ronan675
In that case does anyone know how to fix this phpize problem of mine?
Dave#
mmcache still blows up on my server:

root@selhurst [~]# grep 'MMCACHE: PHP crashed' /usr/local/apache/logs/error_log
MMCACHE: PHP crashed on opline 199 of () at :0
ronan675
In case anyone else has the same problem I needed to install the PHP-devel package to use phpize.

http://rpmfind.net/linux/rpm2html/search.p...hp?query=phpize
lorenzo
Work MMCache also on RH 7.2 Box ?
They only tested it on RH 7.0,7.3 and 8.0
http://www.turcksoft.com/en/e_mmc.htm#compat
What ist better ? MM Cache or Zend Accelerator ?
Is it true,that they both together dont work on one box ?
levovich
I have mmcache running on RH 7.2. I don't think, you can install both Zend and mmchache on one box.
jmr
not support by mmcache which is a shame!
LangTuDaTinh
MMCACHE: PHP crashed on opline 263096 of () at :0

[Thu May 22 04:59:02 2003] [notice] caught SIGTERM, shutting down


how to fix this??? thanks
Edgewize
QUOTE
Originally posted by LangTuDaTinh
MMCACHE: PHP crashed on opline 263096 of () at :0

[Thu May 22 04:59:02 2003] [notice] caught SIGTERM, shutting down

how to fix this??? thanks
You can't fix it, its a crash that happens in PHP. If it only occurs rarely, just ignore it ... it happens just as much, if not more, with PHPA or Zend. They just print different messages, or silently swallow the error without saying anything.

If it is happening nonstop, or more often than you think is safe, you'll just have to uninstall mmcache.
Dave#
QUOTE
Originally posted by Edgewize
You can't fix it, its a crash that happens in PHP.  If it only occurs rarely, just ignore it ... it happens just as much, if not more, with PHPA or Zend.  They just print different messages, or silently swallow the error without saying anything.

If it is happening nonstop, or more often than you think is safe, you'll just have to uninstall mmcache.


personally I think if you see it at all then get rid asap
Erwin
Updated the first post to version 3.11
LangTuDaTinh
real big problemm


after i install this, and ChkRootKit, LibSafe, and SIM then my vbb users start to get "forbidden message" but if they refresh it then no more...

is it cause by MMcache???, i removed Sim command from crontab.

thanks
Proetorian
Turck MMCache version 2.3.12 was released on May 22nd. It addresses the following issues with the previous release:

- Bug with too many open files was fixed
- low levels spinlocks on x86 was disabled by default

You can get it at:

wget http://aleron.dl.sourceforge.net/sourcefor...e-2.3.12.tar.gz
Erwin
Instructions upgraded for version 2.3.12

The latest version 2.3.12 seems to be the most stable... icon_smile.gif
Proetorian
If you experience problems with a downed server after recompiling and installing mmcache and editing /etc/php.ini, then I recommend that you restart your server as follows:

service httpd restart
Erwin
QUOTE
Originally posted by Proetorian
If you experience problems with a downed server after recompiling and installing mmcache and editing /etc/php.ini, then I recommend that you restart your server as follows:

service httpd restart


Well, you should do this each time you edit php.ini - I should have made it clear in my instructions. Updated. icon_smile.gif Always restart Apache if you make changes to php.ini
-ToXiC-
for those who have the problem when running phpize:

It will tell you to update aclocal. Which doesn't do anything..

Here is my temporary fix for this. You are following at your own risk. This is not how the installation should be done.

skip phpize, and start at the ./configure point.

Like I said, that is not how turck suggests it to be installed. It is however running just fine like that on a production box.

Since I seem to be at a loss finding technical help on mmcache period, this is what I came up with.

If there is a real fix for this (besides "run aclocal" <- does not work!) please share it. Myself and others are having this problem.

php v = 4.3.1
LangTuDaTinh
after intall this stupid software,.... now each time i restart my server

I got this message



Starting httpd: Ouch! ap_mm_create(1048576, "/var/run/httpd.mm.5868") failed Error: MM: mm:core: failed to acquire semaphore (No space left on device): OS: Identifier removed


the worse part is that i got this message every time i use service httpd restart even that command

echo 250 32000 32 250 > /proc/sys/kernel/sem

can't help ...i have to reboot my computer.

so is there a way that i can remove this completely?

thanks
Erwin
QUOTE
Originally posted by LangTuDaTinh

so is there a way that i can remove this completely?

thanks


Sure, just edit your php.ini, remove the lines you added, and restart Apache.
Proetorian
QUOTE
Originally posted by LangTuDaTinh
after intall this stupid software,.... now each time i restart my server

I got this message



Starting httpd: Ouch! ap_mm_create(1048576, "/var/run/httpd.mm.5868") failed Error: MM: mm:core: failed to acquire semaphore (No space left on device): OS: Identifier removed


the worse part is that i got this message every time i use service httpd restart even that command

echo 250 32000 32 250 > /proc/sys/kernel/sem

can't help ...i have to reboot my computer.

so is there a way that i can remove this completely?

thanks


This is an Apache problem and not Turck's. This problem stems from Apache not cleaning the allocated Semaphore arrays on exit or otherwise errored exits. Even increasing the max semaphore arrays with sysctl will result only in a temporary fix. This problem is common to most, if not all, the php accelerators including Turck's, PHPA, AfterBurner, etc. This problem is resident in Apache.

Rebooting resets the allocated semaphore arrays. The more practical solution to this problem is setting up a cron job that cleans the semaphore arrays automatically on a pre-scheduled basis, either through a daily or a weekly cron. I personally have chosen to take the weekly route. To do so, I created a file in /etc/cron.weekly called apache_sclean as follows:

pico -w /etc/cron.weekly/apache_sclean

Copy and paste the following:

#!/bin/sh
/sbin/service httpd stop
/usr/bin/ipcrm sem $(/usr/bin/ipcs -s | grep apache | awk '{print$2}')
rm -f /tmp/session_mm_*.sem
rm -f /tmp/sess_*
rm -f /tmp/_*.wrk
/sbin/service httpd start


Ctrl+X and Y and to save and exit.

chmod the file to 711.

The credit for this solution goes to rfxn and foggy. You can see the original thread that addresses this problem at:

http://forums.rackshack.net/showthread.php...&threadid=13916

I hope this helps.
-ToXiC-
SIM will also do this for you. icon_smile.gif
Arie
QUOTE
Originally posted by -ToXiC-
for those who have the problem when running phpize:

It will tell you to update aclocal. Which doesn't do anything..

Here is my temporary fix for this. You are following at your own risk. This is not how the installation should be done.

skip phpize, and start at the ./configure point.

Like I said, that is [b]not
how turck suggests it to be installed. It is however running just fine like that on a production box.  

Since I seem to be at a loss finding technical help on mmcache period, this is what I came up with.

If there is a real fix for this (besides "run aclocal" <- does not work!) please share it. Myself and others are having this problem.

php v = 4.3.1 [/B]


I had that problem. My workaround was to upload the mmcache.so binary I created on my home machine (running the same versions of RH, Apache and PHP). This seems to work fine for me.... YMMV
Proetorian
TurckSoft MMcache v2.3.13 has been released today. It contains the following fixes:

- mmcache session handling was implemented. It will be interesting for Windows users who did not have fast shared memory session storage. (see mmcache_set_session_handlers() function)
- mmcache_gc() function was implemented. It removes all expired
values from MMCache shared storage.
- saving/restoring user cache (session data and values which were cached by mmcache_put() function) on httpd shutdown/startup
- libmm replacement was implemented to avoid libmm limitations
- an optimizer's bug was fixed

In addition, PHP v4.3.2 was released earlier today. I have not tried it yet. Has anyone attempted to update to PHP v4.3.2 with Ensim 3.1.10 and TurckSoft MMcache?

If so, please share your experience and any incompatibility issues you may have encountered.

Thanks.
aventure
I've gone off this, causes php to crash alot.
Proetorian
I have been using MMcache for a while now and have not had any issues with running with PHP 4.3.1 and Ensim. However, I am concerned about compatibility issues between Ensim and PHP 4.3.2 and/or MMcache and PHP 4.3.2.
Edgewize
I just compiled and installed PHP 4.3.2 from source, and the latest MMCache (.13) as well. No problems so far, sites are running very smoothly. There are a lot of potential crash-bugs fixed in these releases, so I highly recommend an upgrade.

Just make sure to re-phpize, re-configure, and re-compile MMCache after upgrading PHP 4.3.2 (don't forget to do a full 'make install' for PHP to get the new phpize settings).

Also, double-check your httpd.conf file before restarting apache, since PHP's installation script may have added some extra or incorrect LoadModule lines.
Proetorian
Thanks Edgewize for your input. I am going to update PHP tonight to 4.3.2 and I will post my results as well.
Proetorian
Success!

I am now running PHP 4.3.2 with MMCache 2.3.13 and my server is screaming!! What a rush!!

Thanks for the encouragement Edgewize. icon_biggrin.gif
Proetorian
I ran some benchmark tests to gage the gain I am realizing from using MMcache. My tests on a P4 1.7GHz w/ 512MB RAM, PHP 4.3.2 and MMcache 2.3.13 provided gains of upward of 225% over the standard Zend optimization.

For detailed information on the benchmark tests and results, see this thread:

http://forums.rackshack.net/showthread.php...&threadid=19188
indyjon
Erwin....

Maybe you could note in the original thread....

In Redhat 9, extensions are scanned in via individual ini files in from /etc/php.d/

For example, create file /etc/php.d/mmcache.ini and insert the following:

------------------------------------
zend_extension="/mmcache/turck-mmcache-2.3.13/modules/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
------------------------------------
indyjon
QUOTE
Originally posted by jmr
not support by mmcache which is a shame!


Are you referring to the loader?

If so then I wanted to let you know that I got the ioncube loader and mmcache working at the same time. Just install mmcache as a php extension and keep ioncube loader as a zend_extension.
indyjon
I wanted to point out that version turck-mmcache-2.3.14 is available.
Proetorian
QUOTE
Originally posted by indyjon
I wanted to point out that version turck-mmcache-2.3.14 is available.


I ended up switching back to mmcache 2.3.13 because 2.3.14 disables the phpinfo() function when recompiling php.
aventure
2.3.15 has been released today.
martinjr76
is the folder /tmp/mmcache supposed to be empty? mine seems to be empty all the time
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.