产品服务AMH 免费服务器主机面板SSL证书 免费SSL证书申请 担保单 免费安全、零费率交易平台编程助手免费智能写代码、翻译AMYSQL 免费MySQL管理工具

AMH 社区首页

 AMH社区 - 开放自由有价值的社区

[求助帖] 根据APC模块改写的APCu模块代码,请检阅

Yusky
金牌会员
11307.70 价值分

Yusky 发表于 2013-10-25 23:43:55
本帖最后由 Yusky 于 2013-10-26 03:31 编辑

#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin;

#info
function amh_module_info()
{
echo 'AMH-ModuleName: APCu-4.0.2';
echo 'AMH-ModuleDescription: APCu, 全称:Alternative PHP Cache – User 。继承 APC 的所有内容,并且兼容支持 APC 的软件,支持最新的 PHP 5.5 版本,Discuz 论坛的缓存机制也支持 APCu。';
echo 'AMH-ModuleButton: 安装/卸载';
echo 'AMH-ModuleDate: 2013-10-27';
echo 'AMH-ModuleWebSite: https://yusky.me';
echo 'AMH-MoudleScriptBy: Yusky';
}

#install
function amh_module_install()
{
if amh_module_status ; then
exit;
else
cd /usr/local/;
wget -c http://pecl.php.net/get/apcu-4.0.2.tgz;
tar xzvf apcu-4.0.2.tgz;
cd apcu-4.0.2;
/usr/local/php/bin/phpize;
./configure --enable-apcu --with-php-config=/usr/local/php/bin/php-config ;
make && make install;

cat >> /etc/php.ini <<EOF
[APCu]
extension = "apcu.so"'
EOF
amh php reload;
amh_module_status;
fi;
}

#uninstall
function amh_module_uninstall()
{
if amh_module_status ; then
cd /usr/local/;
rm -f apcu-4.0.2.tgz;
rm -rf apcu-4.0.2;
rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/apcu.so;
sed -i "/apcu.*/d" /etc/php.ini;
sed -i "/\[APCu\]/d" /etc/php.ini;
amh php reload;
echo '[OK] APC-4.0.2 Uninstall successful.';
else
exit;
fi;
}

#status
function amh_module_status()
{
if grep -q '\[APCu\]' /etc/php.ini; then
echo '[OK] APCu-4.0.2 is already installed.';
return 0;
else
echo '[Notice] APCu-4.0.2 is not installed.';
return 1;
fi;
}
在某人博客上看到这个APCu了。 扒过来了。 A大看看这样对不对。 @amysql
~~PHPINFO木看到APC。。 我手动安装了。木发现啥问题
[root@server local]# cd apcu-4.0.2
[root@server apcu-4.0.2]# make test
/bin/sh /usr/local/apcu-4.0.2/libtool --mode=install cp ./apcu.la /usr/local/apcu-4.0.2/modules
cp ./.libs/apcu.so /usr/local/apcu-4.0.2/modules/apcu.so
cp ./.libs/apcu.lai /usr/local/apcu-4.0.2/modules/apcu.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/apcu-4.0.2/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apcu-4.0.2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP : /usr/local/php/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.27
ZEND_VERSION: 2.3.0
PHP_OS : Linux - Linux server.xcsq.eu 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64
INI actual : /usr/local/apcu-4.0.2/tmp-php.ini
More .INIs :
CWD : /usr/local/apcu-4.0.2
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2013-10-26 03:25:27
=====================================================================
PASS Looped regression test (may take a while) (from tests/lang/024.phpt) [tests/024.phpt]
SKIP APC: Bug #61742 preload_path does not work due to incorrect string length (variant 1) (php 5.4) [tests/apc54_014.phpt] reason: PHP 5.4+ only
SKIP APC: Bug #59938 APCIterator fails with large user cache [tests/apc54_018.phpt] reason: PHP 5.4+ only
PASS APC: apc_store/fetch with strings [tests/apc_001.phpt]
PASS APC: apc_store/fetch with objects [tests/apc_002.phpt]
SKIP APC: apc_store/fetch with objects (php pre-5.3) [tests/apc_003.phpt]
PASS APC: apc_store/fetch with objects (php 5.3) [tests/apc_003b.phpt]
PASS APC: apc_store/fetch with bools [tests/apc_004.phpt]
PASS APC: apc_store/fetch with arrays of objects [tests/apc_005.phpt]
PASS APC: apc_store/fetch reference test [tests/apc_006.phpt]
PASS APC: apc_inc/apc_dec test [tests/apc_007.phpt]
PASS APC: apc_cas test [tests/apc_008.phpt]
PASS APC: apc_store/fetch/add with array of key/value pairs. [tests/apc_010.phpt]
PASS APC: apc_fetch resets array pointers [tests/apc_011.phpt]
PASS APC: bindump user cache, variation 1 [tests/apc_bin_001.phpt]
PASS APC: bindump user cache, variation 2 [tests/apc_bin_002.phpt]
PASS APC: bindump user cache, variation 3 [tests/apc_bin_003.phpt]
PASS APC: bindump user cache, variation 4 (check apc_bin_* aliases work) [tests/apc_bin_004.phpt]
SKIP APC: Bug #63224 error in __sleep whit reference to other classes [tests/bug63224.phpt] reason: PHP 5.4+ only
PASS APC: APCIterator general [tests/iterator_001.phpt]
PASS APC: APCIterator regex [tests/iterator_002.phpt]
PASS APC: APCIterator chunk size [tests/iterator_003.phpt]
PASS APC: APCIterator regex & chunk size & list [tests/iterator_004.phpt]
PASS APC: APCIterator delete [tests/iterator_005.phpt]
PASS APC: APCIterator formats [tests/iterator_006.phpt]
SKIP APC: APCIterator Overwriting the ctor [tests/iterator_007.phpt] reason: compiled with APC compatibility
PASS APC: APCIterator::__construct() signature compatibility [tests/iterator_008.phpt]
=====================================================================
TIME END 2013-10-26 03:25:30

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 36
---------------------------------------------------------------------

Number of tests : 27 22
Tests skipped : 5 ( 18.5%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 22 ( 81.5%) (100.0%)
---------------------------------------------------------------------
Time taken : 3 seconds
=====================================================================

This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]: y

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text): yusky@live.it

Posting to http://qa.php.net/buildtest-process.php

Thank you for helping to make PHP better.
支持
评价: 这个问题有价值吗?  没有 (0分)   有, 感谢 (0分)
2013-10-25 23:43:55 1

Yusky
金牌会员
11307.70 价值分

支持 支持第一次扒模块~~求加加~~
评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2013-10-25 23:44:16 2

Yusky
金牌会员
11307.70 价值分

根据教程。安装是安装好了。就是木检测到。。。。。。 支持 支持不知道啥问题捏
评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2013-10-25 23:48:08 3

Yusky
金牌会员
11307.70 价值分

哦耶。检测到了。。。不知道咋出来的。。重启了下服务器
apc
APC supportEmulated

apcu
APCu Supportenabled
Version4.0.2
APCu DebuggingDisabled
MMAP SupportEnabled
MMAP File Maskno value
Serialization Supportphp, eval
Revision$Revision: 328290 $
Build DateOct 26 2013 02:33:28


DirectiveLocal ValueMaster Value
apc.coredump_unmapOffOff
apc.enable_cliOffOff
apc.enabledOnOn
apc.entries_hint40964096
apc.gc_ttl36003600
apc.mmap_file_maskno valueno value
apc.preload_pathno valueno value
apc.rfc1867OffOff
apc.rfc1867_freq00
apc.rfc1867_nameAPC_UPLOAD_PROGRESSAPC_UPLOAD_PROGRESS
apc.rfc1867_prefixupload_upload_
apc.rfc1867_ttl36003600
apc.serializerphpphp
apc.shm_segments11
apc.shm_size32M32M
apc.slam_defenseOnOn
apc.smart00
apc.ttl00
apc.use_request_timeOnOn
apc.writable/tmp/tmp


评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2013-10-26 03:34:44 4

amysql
创始人
99532.51 价值分

评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2013-10-26 13:59:12 5

AMH面板 - 好用高效低占用、安全可靠极稳定

Yusky
金牌会员
11307.70 价值分

引用:
amysql 发表于 2013-10-26 13:59
跟这个一样,其实没必要。
http://amysql.com/bbs/post-918-1-1.htm



好的,知道啦
评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2013-10-26 14:46:26 6
 1  (总1页)
AMH社区列表
用户服务中心