<? //============用来循环计算的compute.php文件================// $a=0; $t=time(); for($i=0;$i<6000000;$i++) {$a=$a*$i;} $t1=time(); echo "<p>"; echo "It used:"; echo $t1-$t; echo "seconds"; ?>
<?php if (!is_callable("mmcache_load") &&!@dl((PHP_OS=="WINNT"||PHP_OS=="WIN32")?" TurckLoader.dll":"TurckLoader.so")) { die("This PHP script has been encoded with Turck MMcache, to run it you must install <a href="http://turck-mmcache.sourceforge.net/">Turck MMCache or Turck Loader</a>");} return mmcache_load('eJzz9XV2dPZwZWBiYGBgZABR zAwgoM0AAakggoODIxgozQxU wJDIqMbIyMDIiCy ZBqVtGMCmMDKzAOmSzNzUdHT dJYxqTIwMLIwYxmYiGRvACBc UBqplZGzojYbbpSvMxCARhtC mBNSjxQOTRdIahn CxJNhOLQGs7mXC5V5QkJQYAt 3FwMDCBNOqwcgMC iCbAjskEQ4gy7NEobQ4NcUK7 hImuJeZgJazMGkwMSBpYQeyi lOT8/NSipFEQeoV7BghwQAEAM45H7 Y=');?>
网站
如何获得turck-mmcache
安装
tar zxvf 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
extension="mmcache.so" mmcache.shm_size="16" mmcache.cache_dir="/tmp/mmcache" mmcache.enable="1" mmcache.optimizer="1" mmcache.check_mtime="1" mmcache.debug="0" mmcache.filter="" mmcache.shm_max="0" mmcache.shm_ttl="0" mmcache.shm_prune_period="0" mmcache.shm_only="0" mmcache.compress="1"
/etc/rc.d/rc.httpd restart
测试
<? //============用来循环计算的compute.php文件================// $a=0; $t=time(); for($i=0;$i<6000000;$i++) {$a=$a*$i;} $t1=time(); echo "<p>"; echo "It used:"; echo $t1-$t; echo "seconds"; ?>
cp /usr/local/turck-mmcache-2.4.6/encoder.php /usr/bin/
#!/bin/sh clear src=$1; echo $src; src2=$src".en"; echo $src2; cp /usr/bin/encoder.php ./encoder.php php encoder.php $src -o $src2; rm encoder.php mv $src $src.bak; mv $src.en $src;
chmod +x encoder mv encoder /usr/bin/
encode compute.php
php_screw和turck-mmcache的区别