mac下phalcon安装与配置

一、phalcon简介,phalcon框架是c实现的php扩展,是php语言中高性能的mvc框架,他的内容不仅是mvc,包含了很多好用的库,比如orm,crypt。另外还提供restful风格的api。

二、phalcon安装

       1)前提是安装了php

       2)下载安装 git clone git://github.com/phalcon/cphalcon.git      

git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
不出意外的话即可安装成功,会出现以下提示。

Build complete.
Don't forget to run 'make test'.

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

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

       3)安装可能会遇到的问题,编译提示Cannot find autoconf,在Mac下直接通过brew install autoconf即可。

       4)根据安装结果的提示,phalcon.so模块安装到了/usr/lib/php/extensions/no-debug-non-zts-20121212目录下,配置php.ini文件,将该扩展添加到文件中。

       extension=phalcon.so,这样配置就可以了,也可以将phalcon.so的绝对路径填在这里。php.ini文件默认是没有的,但是php.ini.default文件是有的,在/etc目录下,可以拷贝php.ini.default文件为php.ini,然后配置。

三、验证安装,在phpinfo()下可以看到phalcon的扩展被显示出来。


四、安装phalcon工具,快速创建phalcon项目。

git clone git://github.com/phalcon/phalcon-devtools.git

cd phalcon-devtools

sudo ./phalcon.sh

安装提示如下,表示安装成功。

Phalcon Developer Tools Installer

Make sure phalcon.sh is in the same dir as phalcon.php
and that you are running this with sudo or as root.

Installing Devtools...
Working dir is: /Users/feiy/Public/phalcon-devtools
Generating symlink...

Done. Phalcon Developer Tools installed!
Thank you for using Phalcon Developer Tools!
We hope that Phalcon Developer Tools helps to make your life easier.

In case of problems: https://github.com/phalcon/phalcon-devtools/issues 
                and: https://forum.phalconphp.com

To start using Phalcon Developer Tools you need to run 'source /Users/feiy/.bash_profile'


Phalcon DevTools (3.2.0)

Available commands:
  info             (alias of: i)
  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)
  console          (alias of: shell, psysh)
安装信息很明确,phalcon-devtool的环境变量已经设置到了~/.bash_profile文件当中了,需要运行 source ~/.bash_profile来生效。

运行source ~/.bash_profile之后,可以在命令行的任意目录下运行phalcon命令,比如:phalcon --version

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

luffy5459

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值