LoginSignup
1
1

More than 5 years have passed since last update.

centOSにPhalconをインストールする

Posted at

PhalconはPHPのフレームワークの一つ。
前々から存在は知っていたけど、触れた事はなかったのであれこれいじってみようとまずはインストールしてみた。

インストール先

手持ちの仮想OSにcentOSがあったのでこれに入れてみる事にする。
バージョンは5.2。ちょっと古いかもしれないけど気にしない。。。

必要要件を満たしているかの確認

Phalconの必要要件は以下。

  • php5.3以上
  • GCC compiler
  • Git

php -v
PHP 5.5.10 (cli) (built: Apr 24 2014 10:06:18)

>php5.3以上はOK

gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)

>GCC compilerも入っている

git --version
git version 1.8.2.1

>gitも大丈夫

インストール手順

Phalconは他のフレームワークと違って少し特殊で
フレームワーク自体はC言語で開発されており、PHPの拡張モジュールとして
取り入れる事になる。
それ故に省メモリかつ処理速度も格段に速い。

では、まず拡張モジュールをgithubから落としてくる
git clone git://github.com/phalcon/cphalcon.gitgit clone git://github.com/phalcon/cphalcon.git
ダウンロード先は任意の場所でOK。

では次にカレントディレクトリを移動させてインストールを行う。
cd cphalcon/build
./install

`Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20121212/
Installing header files: /usr/local/include/php/

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation`

ここまできたら一度サーバーを再起動します。

Phalconを有効にする

php.iniの任意の場所に以下の記述を追加して拡張モジュールを有効にします。
extension=phalcon.so

書いたらapacheを再起動。
これで終わりです。
phpinfoの情報を見てPhalconに記述が出ていればOKです。

1
1
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
1