Phalcon extension Compilation

On platform Linux you can easily compile and install the extension from source code.

Requirements

We need some packages previously installed:

  • PHP 5.x development resources
  • GCC compiler
#Ubuntu sudo apt-get install php5-dev php5-mysql gcc #Fedora sudo yum install php-devel php-mysqlnd gcc libtool #RHEL sudo yum install php-devel php-mysql gcc libtool #Suse yast2 -i php5-pear php5-devel php5-mysql gcc

Compilation

1. To create the extension from C source follow the next steps:

git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install

2. Add the extension to your php.ini:

extension=phalcon.so

3. Finally restart the webserver

Debian

There is a repo graciously offered by FortRabbit here

Package name is php5-phalcon

Arch Linux

There is a PKGBUILD for ArchLinux, available here

OpenSUSE

There is package available here (thanks to Mariusz Łączak

FreeBSD

A port is available for FreeBSD. Just only need these simple line commands to install it:

# pkg_add -r phalcon
or
# cd /usr/ports/www/phalcon && make install clean

Dependencies

Although Phalcon does not binary link to other extensions it does use some of them to offer functionality. The extensions used are:

  • mbstring
  • mcrypt
  • openssl
  • PDO
  • PDO/Mysql
  • PDO/Postgresql
  • PDO/Sqlite
  • PDO/Oracle
  • Mongo

It is not necessary for all the above extensions to be present in the system that has Phalcon installed. You can only install the ones that meet your needs. For instance if you use a MySQL database, then you can only load PDO and PDO/MySQL ignoring the Oracle, SQlite, Postgresql and Mongo.

编译时出现:

../libtool: line 832: X--tag=CC: command not found
../libtool: line 865: libtool: ignoring unknown tag : command not found
../libtool: line 832: X--mode=compile: command not found
../libtool: line 998: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 999: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 1142: Xgcc: command not found
../libtool: line 1142: X-DHAVE_CONFIG_H: command not found
../libtool: line 1142: X-I.: command not found
../libtool: line 1142: X-I../include: No such file or directory
../libtool: line 1142: X-g: command not found
../libtool: line 1142: X-I/usr/local/include: No such file or directory
../libtool: line 1142: X-g: command not found
../libtool: line 1142: X-O2: command not found
../libtool: line 1142: X-MT: command not found
../libtool: line 1142: Xargs.lo: command not found
../libtool: line 1142: X-MD: command not found
../libtool: line 1142: X-MP: command not found
../libtool: line 1142: X-MF: command not found
../libtool: line 1142: X.deps/args.Tpo: No such file or directory
../libtool: line 1142: X-c: command not found
../libtool: line 1193: Xargs.lo: command not found
../libtool: line 1198: libtool: compile: cannot determine name of library object from `': command not found

原因据说是因为在项目目录下生成的libtool脚本中定义了$ECHO变量,但是在脚本文件ltmain.sh中,使用的却是$echo(生成的libtool版本太旧)

可通过以下方法解决:

1. 直接复制系统自带的libtool到项目目录,应该在/usr/bin目录下,覆盖代码文件目录下的libtool,再执行make

(没装就apt-get install libtool 或者 yum install libtool 安装一下吧)

2.  修改aclocal.m4文件,将上面的LIBTOOL='$(SHELL) $(top_builddir)/libtool'改成LIBTOOL='$(SHELL)  /usr/bin/libtool'后重新执行./configure

3. 将源码目录下libtool脚本中所有的$ECHO替换成$echo. 或者将脚本文件ltmain.sh里的$echo替换成$ECHO,都一样,重新执行./configure

没找到,后直接在ext下编译

Phalcon\DI\InjectionAwareInterface
Phalcon\Validation\ValidatorInterface
Phalcon\Mvc\Model\ValidatorInterface
Phalcon\Events\EventsAwareInterface
Phalcon\Cache\FrontendInterface
Phalcon\Cache\BackendInterface
Phalcon\Db\DialectInterface
Phalcon\Mvc\Model\MetaDataInterface
Phalcon\Db\AdapterInterface
Phalcon\Logger\FormatterInterface
Phalcon\Logger\AdapterInterface
Phalcon\Paginator\AdapterInterface
Phalcon\Annotations\AdapterInterface
Phalcon\FlashInterface
Phalcon\Mvc\Model\ResultInterface
Phalcon\Mvc\Model\BehaviorInterface
Phalcon\Mvc\View\EngineInterface
Phalcon\Mvc\Model\ResultsetInterface
Phalcon\Exception
Phalcon\Db\Adapter
Phalcon\DispatcherInterface
Phalcon\DI\Injectable
Phalcon\Mvc\Router\RouteInterface
Phalcon\Mvc\CollectionInterface
Phalcon\Mvc\Model\TransactionInterface
Phalcon\Mvc\DispatcherInterface
Phalcon\Mvc\Model\QueryInterface
Phalcon\Mvc\Model\Query\StatusInterface
Phalcon\Mvc\Model\Query\BuilderInterface
Phalcon\Mvc\RouterInterface
Phalcon\Mvc\ViewInterface
Phalcon\Http\RequestInterface
Phalcon\Http\ResponseInterface
Phalcon\Db\ReferenceInterface
Phalcon\Db\ColumnInterface
Phalcon\Db\IndexInterface
Phalcon\Http\Request\FileInterface
Phalcon\Http\Response\CookiesInterface
Phalcon\Mvc\ModelInterface
Phalcon\Mvc\UrlInterface
Phalcon\Mvc\Micro\CollectionInterface
Phalcon\Http\Response\HeadersInterface
Phalcon\DiInterface
Phalcon\Mvc\Model\ManagerInterface
Phalcon\FilterInterface
Phalcon\Session\AdapterInterface
Phalcon\EscaperInterface
Phalcon\Acl\ResourceInterface
Phalcon\Session\BagInterface
Phalcon\CryptInterface
Phalcon\Acl\RoleInterface
Phalcon\Acl\AdapterInterface
Phalcon\Events\ManagerInterface
Phalcon\Mvc\Model\MessageInterface
Phalcon\DI\ServiceInterface
Phalcon\Mvc\Model\CriteriaInterface
Phalcon\Mvc\Model\Transaction\ManagerInterface
Phalcon\Mvc\Model\RelationInterface
Phalcon\Annotations\ReaderInterface
Phalcon\Translate\AdapterInterface
Phalcon\DI
Phalcon\Forms\Element
Phalcon\Mvc\Model\Validator
Phalcon\Validation\Validator
Phalcon\Cache\Backend
Phalcon\Db\Adapter\Pdo
Phalcon\Db\Dialect
Phalcon\Mvc\Model\MetaData
Phalcon\Annotations\Adapter
Phalcon\Logger\Formatter
Phalcon\Logger\Adapter
Phalcon\Flash
Phalcon\Mvc\Model\Behavior
Phalcon\Dispatcher
Phalcon\Mvc\Model\Resultset
Phalcon\Mvc\View\Engine
Phalcon\Mvc\Model\Exception
Phalcon\Assets\Resource
Phalcon\Config
Phalcon\Session\Adapter
Phalcon\Acl\Adapter
Phalcon\Translate\Adapter
Phalcon\DI\FactoryDefault
Phalcon\Mvc\Router
Phalcon\Tag
Phalcon\Acl
Phalcon\Db
Phalcon\Cache\Exception
Phalcon\Cache\Multiple
Phalcon\Cache\Backend\Apc
Phalcon\Cache\Backend\File
Phalcon\Cache\Backend\Mongo
Phalcon\Cache\Backend\Memory
Phalcon\Cache\Backend\Memcache
Phalcon\Cache\Frontend\Output
Phalcon\Cache\Frontend\None
Phalcon\Cache\Frontend\Json
Phalcon\Cache\Frontend\Base64
Phalcon\Cache\Frontend\Data
Phalcon\Tag\Select
Phalcon\Tag\Exception
Phalcon\Paginator\Exception
Phalcon\Paginator\Adapter\Model
Phalcon\Paginator\Adapter\QueryBuilder
Phalcon\Paginator\Adapter\NativeArray
Phalcon\Validation
Phalcon\Validation\Message
Phalcon\Validation\Exception
Phalcon\Validation\Message\Group
Phalcon\Validation\Validator\Email
Phalcon\Validation\Validator\Regex
Phalcon\Validation\Validator\Identical
Phalcon\Validation\Validator\Between
Phalcon\Validation\Validator\Confirmation
Phalcon\Validation\Validator\PresenceOf
Phalcon\Validation\Validator\ExclusionIn
Phalcon\Validation\Validator\StringLength
Phalcon\Validation\Validator\InclusionIn
Phalcon\Db\Index
Phalcon\Db\Column
Phalcon\Db\Adapter\Pdo\Sqlite
Phalcon\Db\Adapter\Pdo\Mysql
Phalcon\Db\Adapter\Pdo\Oracle
Phalcon\Db\Adapter\Pdo\Postgresql
Phalcon\Db\Dialect\Oracle
Phalcon\Db\Dialect\Mysql
Phalcon\Db\Dialect\Sqlite
Phalcon\Db\Dialect\Postgresql
Phalcon\Db\Exception
Phalcon\Db\Profiler
Phalcon\Db\Profiler\Item
Phalcon\Db\Reference
Phalcon\Db\RawValue
Phalcon\Db\Result\Pdo
Phalcon\Db\ResultInterface
Phalcon\Acl\Role
Phalcon\Acl\Resource
Phalcon\Acl\Adapter\Memory
Phalcon\Acl\Exception
Phalcon\Text
Phalcon\Kernel
Phalcon\Security
Phalcon\Security\Exception
Phalcon\Version
Phalcon\Session
Phalcon\Session\Bag
Phalcon\Session\Exception
Phalcon\Session\Adapter\Files
Phalcon\Filter
Phalcon\DI\Exception
Phalcon\DI\FactoryDefault\CLI
Phalcon\DI\Service
Phalcon\DI\Service\Builder
Phalcon\Filter\Exception
Phalcon\Filter\UserFilterInterface
Phalcon\Flash\Direct
Phalcon\Flash\Session
Phalcon\Flash\Exception
Phalcon\CLI\Task
Phalcon\CLI\Router
Phalcon\CLI\Console
Phalcon\CLI\Console\Exception
Phalcon\CLI\Dispatcher
Phalcon\CLI\Dispatcher\Exception
Phalcon\CLI\Router\Exception
Phalcon\Annotations\Reader
Phalcon\Annotations\Exception
Phalcon\Annotations\Reflection
Phalcon\Annotations\Annotation
Phalcon\Annotations\Collection
Phalcon\Annotations\Adapter\Apc
Phalcon\Annotations\Adapter\Memory
Phalcon\Annotations\Adapter\Files
Phalcon\Loader
Phalcon\Logger
Phalcon\Loader\Exception
Phalcon\Logger\Item
Phalcon\Logger\Multiple
Phalcon\Logger\Exception
Phalcon\Logger\Adapter\Stream
Phalcon\Logger\Adapter\File
Phalcon\Logger\Formatter\Json
Phalcon\Logger\Adapter\Syslog
Phalcon\Logger\Formatter\Line
Phalcon\Logger\Formatter\Syslog
Phalcon\Config\Exception
Phalcon\Config\Adapter\Ini
Phalcon\Forms\Form
Phalcon\Forms\Manager
Phalcon\Forms\Exception
Phalcon\Forms\Element\File
Phalcon\Forms\Element\Text
Phalcon\Forms\Element\Date
Phalcon\Forms\Element\Hidden
Phalcon\Forms\Element\Numeric
Phalcon\Forms\Element\Submit
Phalcon\Forms\Element\Check
Phalcon\Forms\Element\Select
Phalcon\Forms\Element\Password
Phalcon\Forms\Element\TextArea
Phalcon\Crypt
Phalcon\Translate
Phalcon\Translate\Exception
Phalcon\Translate\Adapter\NativeArray
Phalcon\Crypt\Exception
Phalcon\Escaper
Phalcon\Escaper\Exception
Phalcon\Assets\Manager
Phalcon\Assets\Exception
Phalcon\Assets\Resource\Js
Phalcon\Assets\Collection
Phalcon\Assets\Resource\Css
Phalcon\Http\Cookie
Phalcon\Http\Request
Phalcon\Http\Response
Phalcon\Http\Cookie\Exception
Phalcon\Http\Request\File
Phalcon\Http\Response\Cookies
Phalcon\Http\Response\Headers
Phalcon\Http\Request\Exception
Phalcon\Http\Response\Exception
Phalcon\Queue\Beanstalk
Phalcon\Queue\Beanstalk\Job
Phalcon\Mvc\Url
Phalcon\Mvc\View
Phalcon\Mvc\Micro
Phalcon\Mvc\Model
Phalcon\Mvc\Application
Phalcon\Mvc\Application\Exception
Phalcon\Mvc\Collection
Phalcon\Mvc\Controller
Phalcon\Mvc\Collection\Manager
Phalcon\Mvc\Collection\Exception
Phalcon\Mvc\Collection\ManagerInterface
Phalcon\Mvc\ControllerInterface
Phalcon\Mvc\Dispatcher
Phalcon\Mvc\Dispatcher\Exception
Phalcon\Mvc\Model\Query
Phalcon\Mvc\Model\Row
Phalcon\Mvc\Micro\LazyLoader
Phalcon\Mvc\Micro\Collection
Phalcon\Mvc\Micro\Exception
Phalcon\Mvc\Micro\MiddlewareInterface
Phalcon\Mvc\Model\Message
Phalcon\Mvc\Model\Criteria
Phalcon\Mvc\Model\Relation
Phalcon\Mvc\Model\Manager
Phalcon\Mvc\Model\Transaction
Phalcon\Mvc\Model\Query\Lang
Phalcon\Mvc\Model\MetaData\Files
Phalcon\Mvc\Model\MetaData\Apc
Phalcon\Mvc\Model\Query\Status
Phalcon\Mvc\Model\Query\Builder
Phalcon\Mvc\Model\Validator\Url
Phalcon\Mvc\Model\MetaData\Memory
Phalcon\Mvc\Model\Resultset\Complex
Phalcon\Mvc\Model\ValidationFailed
Phalcon\Mvc\Model\Resultset\Simple
Phalcon\Mvc\Model\Validator\Email
Phalcon\Mvc\Model\MetaData\Session
Phalcon\Mvc\Model\Validator\Regex
Phalcon\Mvc\Model\Behavior\SoftDelete
Phalcon\Mvc\Model\Validator\PresenceOf
Phalcon\Mvc\Model\Validator\Uniqueness
Phalcon\Mvc\Model\Transaction\Failed
Phalcon\Mvc\Model\Transaction\Manager
Phalcon\Mvc\Model\Behavior\Timestampable
Phalcon\Mvc\Model\MetaData\Strategy\Annotations
Phalcon\Mvc\Model\MetaData\Strategy\Introspection
Phalcon\Mvc\Model\Transaction\Exception
Phalcon\Mvc\Model\Validator\StringLength
Phalcon\Mvc\Model\Validator\Exclusionin
Phalcon\Mvc\Model\Validator\Inclusionin
Phalcon\Mvc\Model\Validator\Numericality
Phalcon\Mvc\ModuleDefinitionInterface
Phalcon\Mvc\Router\Group
Phalcon\Mvc\Router\Route
Phalcon\Mvc\Router\Exception
Phalcon\Mvc\Router\Annotations
Phalcon\Mvc\User\Plugin
Phalcon\Mvc\User\Module
Phalcon\Mvc\Url\Exception
Phalcon\Mvc\User\Component
Phalcon\Mvc\View\Exception
Phalcon\Mvc\View\Engine\Php
Phalcon\Mvc\View\Engine\Volt
Phalcon\Mvc\View\Engine\Volt\Compiler
Phalcon\Events\Event
Phalcon\Events\Manager
Phalcon\Events\Exception

你可能感兴趣的:(Phalcon extension Compilation)