PHP Phalcon Module for cPanel EasyApache
- Written by Vanessa Vasile
- Published in Apache, Apps, PHP, Scripts
- 37 Comments
- Permalink
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.
37 Comments
Pingback: cPanel/WHM Plugins
nice article; I wanted to enable Phalcon but i dont have admin access to the server. Guess i need to contact my host then?
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.
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!
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.
is this EA module officialy from cPanel or 3rd party?
This module is third-party. We wrote it. https://documentation.cpanel.net/display/EA/Custom+Modules
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
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/ ./
Hi,
This happens with the non-Git option from your instructions. Glad this was in the comments.
Thanks 🙂
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’?
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
A change in EA3 rendered this plugin nonfunctional, however, EA3 itself is EOL so we can’t support this plugin anymore.
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!
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.
Hello Vanessa,
Here is my EA profile configuration http://pastebin.com/CfqqkDjT
Server software is
CentOS 6.6
cPanel/WHM 11.48.0 (build 12)
Thank you in advance!
I’m not able to reproduce the error, but it doesn’t look like this is specifically a problem in the EA plugin. There’s a similar report here, indicating PDO not being installed: https://github.com/phalcon/cphalcon/issues/74
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! 🙂
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?
Is there another extension dir that the module may have been installed into?
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’ !!
Try this:
yum install pcre-devel gcc make
virtual memory exhausted: Cannot allocate memory
make: *** [phalcon.lo] Error 1
As the error indicates, you ran out of memory. This isn’t a problem with the module, it’s a problem with your environment. Talk to your host.
Worked like a charm!
Thanks, Vanessa 😀
I just tried using the module on a brand new server, and the module simply does not show in EA3. 🙁
This is not a common issue, and is typically indicative of the files not being in the correct location.
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?
Technically, yes. Just make sure the source paths and build commands are correct.
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?
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”
Make sure you untarred using the command provided. Please note though this mod no longer works because of recent changes in EA3, and EA3 itself is EOL.
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?
A recent change in EA3 rendered the plugin nonfuntional, not something we did. The plugin no longer works, nor is EA3 still even supported at all by cPanel.
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
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
please be advised that this plugin no longer is supported. EA3 has changes that rendered the plugin nonfunctional and EA3 itself is EOL in favor of EA4.