Phalcon安裝文檔

參考鏈接
Phalcon
Phalcon-devtools
Iphalcon

<code>以下安裝環(huán)境以mac+xampp(php 5.5)為例。</code>


主要安裝分為如下兩步

1、安裝Phalcon的php擴展
2、安裝Phalcon Tools工具

1、安裝Phalcon的php擴展

1、下載phalcon的php擴展源碼包并安裝

普通安裝:
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install

特殊安裝(使用集成的php環(huán)境或使用特別的php版本):
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build/php5/64bits  (具體以自身情況而定)
/Applications/XAMPP/xamppfiles/bin/phpize  (編譯php擴展)
./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config   (配置php所在安裝目錄)
make && sudo make install 

2、配置phalcon擴展

通過以上安裝會在php擴展目錄中生成phalcon.so的擴展文件。
編輯php.ini  將phalcon.so擴展加入
extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
(此處具體目錄根據自己情況而定)

2、安裝Phalcon Tools工具

1、下載安裝Phalcon Tools
git clone https://github.com/phalcon/phalcon-devtools.git
tar -zxvf phalcon-devtools
cd  phalcon-devtools
sudo ln -s ~/phalcon-devtools/phalcon.php /usr/bin/phalcon
chmod ugo+x /usr/bin/phalcon
    執(zhí)行: phalcon commands help
    會出現(xiàn)以下信息:
    Phalcon DevTools (3.0.2)
    Help: 
    Lists the commands available in Phalcon devtools
    Available commands: 
    commands (alias of: list, enumerate) 
    controller (alias of: create-controller) 
    module (alias of: create-module) 
    model (alias of: create-model) 
    all-models (alias of: create-all-models)
    project (alias of: create-project) 
    scaffold (alias of: create-scaffold) 
    migration (alias of: create-migration) 
    webtools (alias of: create-webtools)
2、創(chuàng)建phalcon項目
phalcon project phalcon_test  (會生成phalcon框架文件)
cd phalcon_test
php -S localhost:8000 -t public .htrouter.php(將根目錄指向public目錄)
ok....開始吧

phalcon框架結構如下

 phalcon_test/
 |----app
 |      |----config
 |      |      |----config.php
 |      |      |----loader.php
 |      |      |----services.php
 |      |----controllers
 |      |      |----ControllerBase.php
 |      |      |----IndexController.php
 |      |----library
 |      |----migrations
 |      |----models
 |      |----views
 |      |      |----index
 |      |      |      |----index.volt
 |      |      |----index.volt
 |      |      |----layouts
 |----cache
 |----index.html
 |----public
 |      |----.htaccess
 |      |----index.php
 |      |----css
 |      |----files
 |      |----img
 |      |----js
 |      |----temp
 |----.htrouter.php
 |----.htaccess
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 173,532評論 25 708
  • Welcome 目前網絡上充斥著大量的陳舊信息,讓PHP新手誤入歧途,傳播著錯誤的實踐和糟糕的代碼,這必須得到糾正...
    layjoy閱讀 21,730評論 7 118
  • 生命在初春的陽光綻放,新生和死亡如此交替,夢想總在凌晨時分,似睡非睡之間飄忽間掙扎、演繹、終結。 舍不得生命的愛戀...
    子俠閱讀 419評論 0 4