1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GoogleAppEngine StandardEditionでAPCuを使いたい

Last updated at Posted at 2020-03-23

概要

  • GAE SEでPHP内部キャッシュであるAPCuを使いたい
  • しかしGAE SE(PHP7.2)ではAPCu拡張ライブラリは標準で用意されていなかった
  • GAE FEではphp.iniに追記するだけで使える模様
  • GAE SEでは個別でソースからビルドして組み込めるらしいのでやり方メモを残しておく
  • ビルド環境はUbuntu

詳細

$ mkdir ~/build
$ cd ~/build
$ wget https://pecl.php.net/get/apcu-5.1.18.tgz
$ tar zxf apcu-5.1.18.tgz
$ mv apcu-5.1.18 apcu
$ cd ~/build/apcu
$ apt-get update
$ apt install php7.2-dev
$ phpize
$ ./configure --with-php-config=php-config
$ make
$ ls -l modules/apcu.so
  • 上記でできたapcu.soをいつもGAEをデプロイする環境にコピーする
  • 以下のように配置
$ cd ~
$ ll modules
drwxr-xr-x 2 user user   4096 Mar 17 18:28 ./
drwxr-xr-x 9 user user   4096 Mar 17 18:31 ../
-rw-r--r-- 1 user user 573488 Mar 17 18:25 apcu.so

$ vim php.ini
extension=modules/apcu.so

上記で完了。これでAPCキャッシュが利用可能となる

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?