Phalcon Mac|Window Install Extension

Mac installation and configuration Phalcon extension encountered problems:

Before building a project with the Phalcon framework, you need to install the Phalcon php extension. Before installing, I searched for some documents,

The following are the more common installation methods:

git clone git://github.com/phalcon/cphalcon.git cd cphalcon/build sudo ./install
 encountered some problems during the creation of the extension

1: Prompt that  the php-config --version command does not exist
2: phpize command does not exist

3:error: unknown type name 'zend_array'(typedef struct _zend_op_array zend_op_array
The above problem is mainly the PHP version problem, brew needs to be updated, and the third problem has been searched for a long time, but it has not been solved.
Finally, install the phalcon extension through the brew system, because the xampp integrated environment is used,
Add the phalcon.so extension directly to the php.ini file, pay attention to the system extension path, and solve the problem as follows:
It is recommended to install via brew:
1: #brew add source 
brew update
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/php

#It is best to execute the doctor
brew doctor

2:brew install php56

3: #You can search first:
brew search php56

#Reference installation
brew install php56-gearman php56-msgpack php56-memcache php56-memcached
php56-mongo  php56-phalcon php56-redis php56-xdebug php56-imagick

#Encryption and decryption extension 
brew install php56-mcrypt --build-from- source

#When installing phalcon, the phalcon module cannot be loaded, prompting: NOTICE: PHP message: PHP Warning: PHP Startup: phalcon: Unable to initialize module #If you encounter the problem that the module cannot be loaded after installation, you need to install the extension module When adding the --build-from-source parameter, it means installing from source #update extension
brew upgrade php56-phalcon
Follow the above steps to execute the phalcon system extension step by step and the installation can be successful. The test method is as above
1:touch a.php
2: vi a.php
   <?phpprint_r(get_loaded_extensions());?>
3: php a.php
   In configuration or display extension
    ......

    [55] => xsl

    [56] => zip

    [57] => gearman

    [58] => igbinary

    [59] => imagick

    [60] => mcrypt

    [61] => memcache

    [62] => memcached

    [63] => mongo

    [64] => msgpack

   [65] => phalcon

    [66] => repeat

......

Next, we need to find the extension location where php is installed on the system. You can find the extension configuration location through the command that comes with php (command: php -ini):

/usr/local/etc/php/5.6/conf.d/ext-phalcon.ini

View the extension configuration to view the extension location:

extension="/usr/local/opt/php56-phalcon/phalcon.so"

 

Well, we add the system-installed phalcon extension to the php.ini configuration in the integrated environment, as above,

Now we test phpinfo() in the integrated environment and see the phalcon related information

 

Install the extension in Window, mainly to configure environment variables, and add the phalcon.dll extension to the php environment

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326567329&siteId=291194637