Turck-MMCache

No clue if anyone has done this yet but I just shaved a tedious task that must be done after every php upgrade down to a 30 second job Turck-MMCache

Thought I would share it .

As many of you who run turck-mmcache know, every time you update php to a newer version, you must also re-compile turck-mmcache, which can be rather tedious to do by hand on every webserver.

Simple solution- a shell script.Turck-MMCache

Copy the code below and save it in your root directory ( root@server #[~] ) as a file named turck-installer (or any other name you wish)

Most likely you will have to copy and paste it into a text editor (vi pico, nano, joe, whatever) and save it as file Note , no extension

Next, chmod 755 the file to make it executable, and in order to run it, (after you upgrade php) simply type /root/turck-installer and presto!

Note that I wrote this specifically for a RedHat Linux server. Commands can be edited for other OS's It is for an UPGRADE. this does NOT install turck-mmcache for the first time, This is only for updating- you have to manually edit your php.ini file to enable the turck extension.

Code:
#!/bin/sh
#Installs turck-mmcache 2.4.6 for php 4.x on a cpanel server (run from root)
#Copyright @2004 Brian Gustin (www.controlhosting.net) 
#Released under the GNU General Public License http://www.gnu.org/copyleft/gpl.html
cd /
rm -rf mmcache
rm -rf /tmp/mmcache
mkdir mmcache
cd mmcache
wget http://unc.dl.sourceforge.net/source...e-2.4.6.tar.gz
tar xvzf turck-mmcache-2.4.6.tar.gz
cd turck-mmcache-2.4.6
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-mmcache=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
mkdir /tmp/mmcache
chmod 0777 /tmp/mmcache
/sbin/service httpd restart
echo "mmcache is re-installed"

Hope it helps some of you save a little time during maintenance Turck-MMCache


Bri!

 

 

 

 

Top