2012-10-30 84 views
14

我使用的是this tutorial,它給出了關於如何設置CodeIgniter和Doctrine的詳細說明。我使用笨2.1.0和2.2.1學說,但我得到這個錯誤:Doctrine undefined function apc_fetch

Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() in /Applications/XAMPP/xamppfiles/htdocs/emma_watson_shrine/application/libraries/Doctrine/Common/Cache/ApcCache.php on line 52

你能幫助我嗎?

回答

11

您需要啓用PHP的APC擴展。

跟着this指南。

或者,您可以使用不同的緩存驅動程序,例如memcache,並根據此更改Doctrine配置。

檢查doctrine documentation以獲取備用緩存驅動程序。也許最簡單的解決方案是在開發中使用ArrayCache

4

如果你沒有安裝APC,只是想在第6行,然後運行它的教義,cli.php,改變模式:

define('ENVIRONMENT', 'production'); 

define('ENVIRONMENT', 'development'); 

打開Doctrine.php文件,在第36〜43行,你會看到爲什麼!

+0

這是勾號。非常感謝你。 – Yasitha

3

由於PHP 5.5 APC不再使用。你應該安裝apcu。

E.g.

apt install php5.6-apcu

此處瞭解詳情:

http://php.net/manual/en/opcache.installation.php

併爲那些對PHP 7有一個向後兼容模塊:

apt-get install php7.0-apcu 
apt-get install php7.0-apcu-bc 

此外,您可能需要添加這個倉庫:

apt-add-repository ppa:ondrej/php 
apt-get update 
0

對於任何人得到這個在Mac上,只是用Homebrew安裝apcu

brew install php56-apcu

(並啓用擴展,如果需要的話)。

相關問題