PHP Phalcon Module for cPanel EasyApache

PHP Phalcon Module for cPanel EasyApache
4.46 (89.23%) 13 votes

Update: This module is for EasyApache 3, which is obsolete in favor of EasyApache 4. Due to recent changes in EA3, this module may not work on your server, and this is out of our control. Therefore, this module is currently no longer supported and we recommend using PECL to install it instead until it is supported by cPanel.

Over the last few months I’ve seen a number of requests for Phalcon support within EasyApache.  Bearing in mind that the installation is nothing more than that of a typical PECL module, some would prefer to have integration into cPanel to allow for easier installation and portability though EA templates.

I wrote a simple EasyApache module to integrate Phalcon into PHP builds.  You can find it on Github:

https://github.com/thecpaneladmin/EA-PhalconPHP

To install, simply copy the contents of the repo into /var/cpanel/easy/apache/custom_opt_mods/:

cd /var/cpanel/easy/apache/custom_opt_mods/
git clone https://github.com/thecpaneladmin/EA-PhalconPHP.git .
/scripts/easyapache

If you don’t have git on your server (first, of all, why not?!?):

cd /usr/src
wget https://github.com/thecpaneladmin/EA-PhalconPHP/archive/master.zip
unzip -d /var/cpanel/easy/apache/custom_opt_mods/ master.zip
/scripts/easyapache

 

From EasyApache, you can select Phalcon from the list of PHP modules, and proceed to build.

The phalcon.so extension will be loaded from /usr/local/bin/php.ini, so bear in mind that if you have PHP running as as CGI module (CGI, FastCGI, or suPHP), and utilize a local php.ini file, you may need to add the following line to your local php.ini:

 

extension=phalcon.so

 

Then copy phalcon.so to whatever is defined as the value for extension_dir.

 

Don't be selfish, share!Tweet about this on TwitterShare on RedditShare on TumblrBuffer this pageDigg thisShare on FacebookFlattr the authorEmail this to someoneShare on Google+Pin on PinterestPrint this pageShare on LinkedInShare on StumbleUpon

37 Comments

  1. Pingback: cPanel/WHM Plugins

    1. Vanessa Vasile Reply

      If you at least have SSH access and your host runs PHP under suPHP, you can compile the module locally and load it via your local php.ini file. Otherwise, yes, you would have to contact your host.

  2. James Reply

    Okay, so I did everything here and it doesn’t seem to be appearing in my EasyApache as an option. I added phalcon.so to my extension listing, but the only thing I am unsure how to do is copy the phalcon.so to the exentsion directory. I know where the directory is, but where is the .so file I am copying?

    Sorry if that is a stupid question, but really having trouble figuring out the last part.

    Thanks!

    1. Vanessa Vasile Reply

      It would be listed in the exhaustive options. If it’s not showing up, it’s most likely that the module files are not where they need to be. Make sure they are copied in the exact location referenced in the help. The .so file only exists after the module is compiled. EasyApache will put it there automatically if you use our plugin, otherwise if you compile it manually, when you do ‘make install’ it will copy to the extension folder.

  3. Velizarn Reply

    Hello,

    I’m trying to install Phalcon via EasyApache.
    I downloaded the files to /var/cpanel/easy/apache/custom_opt_mods/ and now my file structure is:

    /var/cpanel/easy/apache/custom_opt_mods/
    EA-PhalconPHP-master/
    Cpanel/
    Easy/
    PHP5/
    PhalconPHP.pm
    LICENSE
    README.md

    but PhalconPHP is not showing up in “Exhaustive List” on my EasyApache.

    Can you tell me what is wrong?

    Regards,
    Velizar

    1. Vanessa Vasile Reply

      Looks like the source was cloned incorrectly. The structure should be:

      /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/PHP5/PhalconPHP.pm

      So, just:

      cd /var/cpanel/easy/apache/custom_opt_mods/ ; rsync -av EA-PhalconPHP-master/ ./

      1. Zaman Reply

        I have changed the structure to
        /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/PHP5/PhalconPHP.pm

        But after that when I enter /scripts/easyapache and run easyApache it doesn’t show ‘PhalconPHP’ in ‘Exhaustive List’?
        Is there anything need to do again to get ‘PhalconPHP’ in ‘Exhaustive List’?

        1. Zaman Reply

          I am getting the following error:
          — Begin step ‘Reinstall pecl extensions’ —
          Reinstalling PHP PECL extension: geoip … PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so: cannot open shared object file: No such file or directory in Unknown on line 0

  4. Velizarn Reply

    Thank you for your help, Vanessa!

    Now my build script ends up with following error message/s:

    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:24:36: error: ext/pdo/php_pdo_driver.h: No such file or directory
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c: In function ‘phalcon_Phalcon_Db_Result_Pdo_init’:
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:93: error: ‘PDO_FETCH_OBJ’ undeclared (first use in this function)
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:93: error: (Each undeclared identifier is reported only once
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:93: error: for each function it appears in.)
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c: In function ‘zim_Phalcon_Db_Result_Pdo_dataSeek’:
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:353: error: ‘pdo_stmt_t’ undeclared (first use in this function)
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:353: error: ‘stmt’ undeclared (first use in this function)
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:397: error: expected expression before ‘)’ token
    /home/cpeasyapache/src/cphalcon-master/ext/db/result/pdo.c:407: error: ‘PDO_FETCH_ORI_NEXT’ undeclared (first use in this function)
    make: *** [db/result/pdo.lo] Error 1
    !! ‘make’ failed with exit code ‘512’ !!

    Do you have any idea if this can be fixed?

    Thank you in advance!

    1. Vanessa Vasile Reply

      I’m not able to reproduce an error. Can you pastebin a copy of your EA profile (/var/cpanel/easy/apache/profile/_main.yaml) so I can attempt to reproduce your environment? Please also tell me what version of cPanel you are running, and whether it’s CentOS 5 or CentOS 6.

      1. Velizarn Reply

        Yes! this was the problem! First I installed PDO and then installed Phalcon – now it seems everything is ok.

        Really appreciate your help! Thank you very much! 🙂

  5. Chris Reply

    I rebuilt EasyApache and upgraded to PHP 5.5 with this module. Somehow, phalcon was not rebuilt properly and error log says “PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so'”

    I tried copying from no-debug-non-zts-2010xxxx but it says its incompatible. Help?

  6. labane.tsilo@gmail.com Reply

    I get the followting error when I build my EasyApache, please assist:

    — Begin step ‘make’ —
    /bin/sh /home/cpeasyapache/src/cphalcon-master/ext/libtool –mode=compile cc -I. -I/home/cpeasyapache/src/cphalcon-master/ext -DPHP_ATOM_INC -I/home/cpeasyapache/src/cphalcon-master/ext/include -I/home/cpeasyapache/src/cphalcon-master/ext/main -I/home/cpeasyapache/src/cphalcon-master/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/cpeasyapache/src/cphalcon-master/ext/phalcon.c -o phalcon.lo
    mkdir .libs
    cc -I. -I/home/cpeasyapache/src/cphalcon-master/ext -DPHP_ATOM_INC -I/home/cpeasyapache/src/cphalcon-master/ext/include -I/home/cpeasyapache/src/cphalcon-master/ext/main -I/home/cpeasyapache/src/cphalcon-master/ext -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/cpeasyapache/src/cphalcon-master/ext/phalcon.c -fPIC -DPIC -o .libs/phalcon.o
    In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27,
    from /home/cpeasyapache/src/cphalcon-master/ext/kernel/main.h:25,
    from /home/cpeasyapache/src/cphalcon-master/ext/phalcon.c:24:
    /usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
    In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27,
    from /home/cpeasyapache/src/cphalcon-master/ext/kernel/main.h:25,
    from /home/cpeasyapache/src/cphalcon-master/ext/phalcon.c:24:
    /usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    /usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    /usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before ‘pcre’
    make: *** [phalcon.lo] Error 1
    !! ‘make’ failed with exit code ‘512’ !!

  7. Bobby Dawson Reply

    I just tried using the module on a brand new server, and the module simply does not show in EA3. 🙁

  8. Kamiel Reply

    Can I use the same script to install Zephir (from Phalcon)? Just for the easy way of installing and integrating on my cpanel servers.
    I want to write some Zephir extensions myself after installing Zephir and integrate them in PHP together with Phalcon.
    I have looked at the script and replacing ‘phalcon’ with ‘zephir’ look fairly easy todo…
    Will that work? Or am I missing something?

  9. Cihan ÖZTÜRK Reply

    Hi,
    I’m trying to install Phalcon via EasyApache on git

    File Info :::
    /var/cpanel/easy/apache/custom_opt_mods/
    Cpanel/
    Easy/
    PHP5/
    PhalconPHP.pm
    LICENSE
    README.md

    Server Info :::
    CENTOS 6.8 x86_64 standard – WHM 56.0 (build 24)

    Phalcon not show on easyapache, have a any idea for work this?

  10. Cisco McArthur Reply

    I am running CENTOS 7.2 x86_64 virtuozzo – server with PHP 5.5. It is giving me an error of “-bash: cd: /var/cpanel/easy/apache/custom_opt_mods/: No such file or directory”

  11. Volts Pots Reply

    Wasted half a day trying to install this thing. Simply does not show in the list.
    File location is 100% correct, tried both Git and ZIP, no result.
    Why develop something, which works only for selected few?

  12. Nani N Reply

    Hi,

    I am trying to install Phalcon on Cpanel server and getting below error.
    /************************************
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so: cannot open shared object file: No such file or directory in Unknown on line 0
    ***********************************************************************************/
    Could you please help on this.

    Thanks
    Nani

  13. Zaman Reply

    Hello,

    I’m trying to install Phalcon via EasyApache.
    I have tried it several times. I have using both git and zip

    I have created the folder structure like below

    /var/cpanel/easy/apache/custom_opt_mods/
    Cpanel/
    Easy/
    PHP5/
    PhalconPHP.pm
    LICENSE
    README.md

    Then tried /scripts/easyapache and also run EasyApache from WHM

    But PhalconPHP is not showing up in “Exhaustive List” on my EasyApache. But a Blank “” Module is shown in “Exhaustive List”. I have selected that.
    But it also not working just shows: “PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so: cannot open shared object file: No such file or directory in Unknown on line 0”

    What is the problem here?

    Below is detail of WHM and OS:
    CENTOS 6.8 x86_64 hyper-v – serve527 WHM 60.0 (build 26).
    PHP Version 5.6.28

    Check phpinfo() at : http://vpszone.info/info.php

Leave a Reply

Your email address will not be published. Required fields are marked *

Log in