Chen Log


Amazon Ubuntu EC2 上安裝 PHP APC

leave a comment »

如果直接在AmazonEC2直接裝 APC會出現:

sudo pecl install apc
sudo: pecl: command not found  (找不到指令)

所以要先安裝 PHP 開發者套件 (就是下面的 php-pear 與 php5-dev)

sudo apt-get install php-pear php5-dev


sudo pecl install apc

只要按 Enter  鍵來用預設值就可以了,


sh: 1: make: not found

ERROR: `make’ failed

的錯誤訊息 請先安裝 sudo apt-get install make )


fatal error: pcre.h: No such file or directory

PCRE is a dependency for installing APC. You can install it pretty quick with

sudo yum install pcre-devel or sudo apt-get install libpcre3-dev

once it’s installed, re-run


スクリーンショット 2013 06 10 21 49 37 

更改 PHP.ini
請用下面的指令打開 php.ini。

sudo vi /etc/php5/apache2/php.ini

然後,往下找到 “Dynamic Extensions” 這一行後,(約在863行)
在下面加入下列的這一行 (也可以直接加在 php.ini 檔案的最後面),
存檔並關閉 php.ini 。

apc.rfc1867 = 1 (此行是增加續傳的功能)

按esc離開編輯狀態,後輸入:wq存檔。執行下任一個指令重新啟動 Apache HTTP Server。

sudo /etc/init.d/apache2 restart 或 sudo service apache2 restart


Written by chenagw

2013/06/10 at 21:31

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: