Google APIs Client Library for PHP 0.6.7 の要件では、 PHP5.3 以上 とあるが、CentOS4 centosplus のパッケージはPHP5.1.6 なので、PHP本家のサイト
から、5.3.27をダウンロード、make install。
すでにCentOS4のリポジトリはメンテナンスされていないので、Base.repoをココ のように書き換える必要がある。
しかしながら、
問題の部分のソースが、
openssl_sign() 関数の "sha256" が存在していないようだ。
あちこちググると、CentOS4の openssl0.9.7 が sha256に対応していないようなのである。
なので、Openssl本家サイト からダウンロードして
あとは、make, make install
そのあと、大事なことだが、/etc/ld.so.confに、/usr/local/openssl/lib を追加し、ldconfig を実行する。
更にPHPを再コンパイルする。
適宜オプションを追加!!
これで動くはずです!
すでにCentOS4のリポジトリはメンテナンスされていないので、Base.repoをココ のように書き換える必要がある。
しかしながら、
"Unable to sign data"なる例外が出てしまい、中断してしまう。
問題の部分のソースが、
- function sign($data) {
- throw new Google_AuthException(
- "PHP 5.3.0 or higher is required to use service accounts.");
- }
- throw new Google_AuthException("Unable to sign data");
- }
- return $signature;
- }
openssl_sign() 関数の "sha256" が存在していないようだ。
あちこちググると、CentOS4の openssl0.9.7 が sha256に対応していないようなのである。
なので、Openssl本家サイト からダウンロードして
- ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared
あとは、make, make install
そのあと、大事なことだが、/etc/ld.so.confに、/usr/local/openssl/lib を追加し、ldconfig を実行する。
更にPHPを再コンパイルする。
- ./configure --prefix=/usr/local/php-5.3.27 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --enable-mbstring --with-curl --with-openssl=/usr/local/openssl
適宜オプションを追加!!
これで動くはずです!