有没有办法使用没有memcache服务的Phpfox?因为我使用的是hostgator共享服务器,其中共享服务器不提供任何内存缓存服务,只能在专用服务器上使用。
我正在使用Phpfox1.5以前托管在亚马逊服务器上,可以使用mecache服务,但它对我来说非常昂贵,所以我想将我的网站从亚马逊改为hostgator托管服务。
致命错误:第64行的/home/latisse/public_html/spicypeeps.com/include/library/phpfox/cache/storage/memcache.class.php中找不到“Memcache”类
答案 0 :(得分:1)
当然,只需在其上添加一个this class的文件:
<?php
// Dummy Memcache for a development environment where Memcache is not installed. Part of mmvc library, https://github.com/kajala/mmvc
// Dependencies: none
//if ( defined('MEMCACHE_COMPRESSED') )
// die( "Memcache seems to be already installed, MemcacheDummy.php should never be included in this case\n" );
define( 'MEMCACHE_COMPRESSED', 1234 ); // dummy value
/**
* Dummy Memcache class for a development environment where Memcache is not installed.
* Note that this class does not do ANYTHING and it is only a convenience for
* the development environment and should never be used in production server.
*/
class Memcache
{
function __construct()
{
}
function connect( $host, $port )
{
assert( is_string($host) );
assert( is_numeric($port) );
return true;
}
function set( $key, $obj, $compressed=false, $expires=0 )
{
assert( is_string($key) );
assert( $compressed === false || $compressed == MEMCACHE_COMPRESSED );
assert( is_numeric($expires) );
return true;
}
function get( $key )
{
assert( is_string($key) || is_array($key) );
return false;
}
}
?>
注意:代码不是我的,并且是根据BSD许可证授权的。原作者:link