{"id":1766,"date":"2017-02-09T08:17:27","date_gmt":"2017-02-09T08:17:27","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=1766"},"modified":"2017-02-10T07:28:56","modified_gmt":"2017-02-10T07:28:56","slug":"phalcon-installation-on-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2017\/02\/09\/phalcon-installation-on-ubuntu-14-04\/","title":{"rendered":"Phalcon Compilation and Installation on Ubuntu 14.04"},"content":{"rendered":"<p>Reference: <a href=\"https:\/\/phalconphp.com\/en\/download\">https:\/\/phalconphp.com\/en\/download<br \/>\n<\/a><a href=\"http:\/\/tecadmin.net\/install-phalcon-php-framework-on-ubuntu\/#\">How To Install Phalcon PHP Framework on Ubuntu 14.10, 14.04 &amp; 12.04<\/a><br \/>\nPhalcon is a C extension, so you need to download a binary for your platform or compile it from source code (SO INSTALL THE BINARY OR COMPILE! CHOOSE ONLY OF THEM!).<br \/>\nInstallation on Ubuntu 14.04:<\/p>\n<p>Install the binary (the easiest way but it don&#8217;t mean it&#8217;d be working!)<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ curl -s https:\/\/packagecloud.io\/install\/repositories\/phalcon\/stable\/script.deb.sh | sudo bash\r\n[sudo] password for teddy: \r\nDetected operating system as Ubuntu\/trusty.\r\nChecking for curl...\r\nDetected curl...\r\nRunning apt-get update... done.\r\nInstalling apt-transport-https... done.\r\nInstalling \/etc\/apt\/sources.list.d\/phalcon_stable.list...done.\r\nImporting packagecloud gpg key... done.\r\nRunning apt-get update... done.\r\n\r\nThe repository is setup! You can now install packages.<\/pre>\n<p>Install the package<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get install php5-phalcon\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nE: Unable to locate package php5-phalcon<\/pre>\n<p>SO the installation is failed! I got the above error. May be because Ubuntu 14.04 has not been supported yet (<a href=\"https:\/\/forum.phalconphp.com\/discussion\/6217\/ubuntu-cant-install-phalcon\">https:\/\/forum.phalconphp.com\/discussion\/6217\/ubuntu-cant-install-phalcon<\/a>). SO IT&#8217;S TIME TO COMPILE THE SOURCE!<br \/>\nBut before installing the source, we need some required packages. Check those packages if they haven&#8217;t been installed in your machine. My ubuntu 14.04 already has &#8216;python-software-properties&#8217;, &#8216;software-properties-common&#8217;, &#8216;php5-dev&#8217;, &#8216;php5-mysql&#8217;, &#8216;gcc&#8217; and &#8216;libpcre3-dev&#8217;. So now I just need to compile the phalcon source code:<\/p>\n<ol>\n<li>Clone the phalcon code\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/cpp$ git clone --depth=1 git:\/\/github.com\/phalcon\/cphalcon.git\r\nCloning into 'cphalcon'...\r\nremote: Counting objects: 2304, done.\r\nremote: Compressing objects: 100% (1837\/1837), done.\r\nremote: Total 2304 (delta 852), reused 1030 (delta 324), pack-reused 0\r\nReceiving objects: 100% (2304\/2304), 3.50 MiB | 1.01 MiB\/s, done.\r\nResolving deltas: 100% (852\/852), done.\r\nChecking connectivity... done.<\/pre>\n<\/li>\n<li>Go into the &#8216;cphalcon\/build&#8217; directory\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/cpp$ cd cphalcon\/build\/<\/pre>\n<p>&nbsp;<\/li>\n<li>then install\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/cpp\/cphalcon\/build$ sudo .\/install\r\nConfiguring for:\r\nPHP Api Version:         20131106\r\nZend Module Api No:      20131226\r\nZend Extension Api No:   220131226\r\nchecking for grep that handles long lines and -e... \/bin\/grep\r\nchecking for egrep... \/bin\/grep -E\r\nchecking for a sed that does not truncate output... \/bin\/sed\r\nchecking whether the C compiler works... yes\r\nchecking for C compiler default output file name... a.out\r\nchecking for suffix of executables... \r\nchecking whether we are cross compiling... no\r\nchecking for suffix of object files... o\r\nchecking whether we are using the GNU C compiler... yes\r\nchecking whether gcc accepts -g... yes\r\nchecking for gcc option to accept ISO C89... none needed\r\nchecking how to run the C preprocessor... gcc -E\r\nchecking for icc... no\r\nchecking for suncc... no\r\nchecking whether gcc and cc understand -c and -o together... yes\r\nchecking for system library directory... lib\r\nchecking if compiler supports -R... no\r\nchecking if compiler supports -Wl,-rpath,... yes\r\nchecking build system type... x86_64-unknown-linux-gnu\r\nchecking host system type... x86_64-unknown-linux-gnu\r\nchecking target system type... x86_64-unknown-linux-gnu\r\nchecking for PHP prefix... \/usr\r\nchecking for PHP includes... -I\/usr\/include\/php\/20131226 -I\/usr\/include\/php\/20131226\/main -I\/usr\/include\/php\/20131226\/TSRM -I\/usr\/include\/php\/20131226\/Zend -I\/usr\/include\/php\/20131226\/ext -I\/usr\/include\/php\/20131226\/ext\/date\/lib\r\nchecking for PHP extension directory... \/usr\/lib\/php\/20131226\r\nchecking for PHP installed headers prefix... \/usr\/include\/php\/20131226\r\nchecking if debug is enabled... no\r\nchecking if zts is enabled... no\r\nchecking for re2c... no\r\nconfigure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.\r\nchecking for gawk... gawk\r\nchecking whether to enable phalcon... yes, shared\r\nchecking whether HAVE_BUNDLED_PCRE is declared... no\r\nchecking whether HAVE_JSON is declared... no\r\nchecking how to print strings... printf\r\nchecking for a sed that does not truncate output... (cached) \/bin\/sed\r\nchecking for fgrep... \/bin\/grep -F\r\nchecking for ld used by gcc... \/usr\/bin\/ld\r\nchecking if the linker (\/usr\/bin\/ld) is GNU ld... yes\r\nchecking for BSD- or MS-compatible name lister (nm)... \/usr\/bin\/nm -B\r\nchecking the name lister (\/usr\/bin\/nm -B) interface... BSD nm\r\nchecking whether ln -s works... yes\r\nchecking the maximum length of command line arguments... 1572864\r\nchecking whether the shell understands some XSI constructs... yes\r\nchecking whether the shell understands \"+=\"... yes\r\nchecking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop\r\nchecking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop\r\nchecking for \/usr\/bin\/ld option to reload object files... -r\r\nchecking for objdump... objdump\r\nchecking how to recognize dependent libraries... pass_all\r\nchecking for dlltool... no\r\nchecking how to associate runtime and link libraries... printf %s\\n\r\nchecking for ar... ar\r\nchecking for archiver @FILE support... @\r\nchecking for strip... strip\r\nchecking for ranlib... ranlib\r\nchecking for gawk... (cached) gawk\r\nchecking command to parse \/usr\/bin\/nm -B output from gcc object... ok\r\nchecking for sysroot... no\r\nchecking for mt... mt\r\nchecking if mt is a manifest tool... no\r\nchecking for ANSI C header files... yes\r\nchecking for sys\/types.h... yes\r\nchecking for sys\/stat.h... yes\r\nchecking for stdlib.h... yes\r\nchecking for string.h... yes\r\nchecking for memory.h... yes\r\nchecking for strings.h... yes\r\nchecking for inttypes.h... yes\r\nchecking for stdint.h... yes\r\nchecking for unistd.h... yes\r\nchecking for dlfcn.h... yes\r\nchecking for objdir... .libs\r\nchecking if gcc supports -fno-rtti -fno-exceptions... no\r\nchecking for gcc option to produce PIC... -fPIC -DPIC\r\nchecking if gcc PIC flag -fPIC -DPIC works... yes\r\nchecking if gcc static flag -static works... yes\r\nchecking if gcc supports -c -o file.o... yes\r\nchecking if gcc supports -c -o file.o... (cached) yes\r\nchecking whether the gcc linker (\/usr\/bin\/ld -m elf_x86_64) supports shared libraries... yes\r\nchecking whether -lc should be explicitly linked in... no\r\nchecking dynamic linker characteristics... GNU\/Linux ld.so\r\nchecking how to hardcode library paths into programs... immediate\r\nchecking whether stripping libraries is possible... yes\r\nchecking if libtool supports shared libraries... yes\r\nchecking whether to build shared libraries... yes\r\nchecking whether to build static libraries... no\r\nconfigure: creating .\/config.status\r\nconfig.status: creating config.h\r\nconfig.status: executing libtool commands\r\n\/bin\/bash \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/libtool --mode=compile gcc  -I. -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits -DPHP_ATOM_INC -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/include -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/main -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits -I\/usr\/include\/php\/20131226 -I\/usr\/include\/php\/20131226\/main -I\/usr\/include\/php\/20131226\/TSRM -I\/usr\/include\/php\/20131226\/Zend -I\/usr\/include\/php\/20131226\/ext -I\/usr\/include\/php\/20131226\/ext\/date\/lib  -DPHALCON_RELEASE -DHAVE_CONFIG_H  -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden   -c \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/phalcon.zep.c -o phalcon.lo \r\nlibtool: compile:  gcc -I. -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits -DPHP_ATOM_INC -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/include -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/main -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits -I\/usr\/include\/php\/20131226 -I\/usr\/include\/php\/20131226\/main -I\/usr\/include\/php\/20131226\/TSRM -I\/usr\/include\/php\/20131226\/Zend -I\/usr\/include\/php\/20131226\/ext -I\/usr\/include\/php\/20131226\/ext\/date\/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/phalcon.zep.c  -fPIC -DPIC -o .libs\/phalcon.o\r\n\/bin\/bash \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/libtool --mode=link gcc -DPHP_ATOM_INC -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/include -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/main -I\/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits -I\/usr\/include\/php\/20131226 -I\/usr\/include\/php\/20131226\/main -I\/usr\/include\/php\/20131226\/TSRM -I\/usr\/include\/php\/20131226\/Zend -I\/usr\/include\/php\/20131226\/ext -I\/usr\/include\/php\/20131226\/ext\/date\/lib  -DPHALCON_RELEASE -DHAVE_CONFIG_H  -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden   -o phalcon.la -export-dynamic -avoid-version -prefer-pic -module -rpath \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/modules  phalcon.lo \r\nlibtool: link: gcc -shared  -fPIC -DPIC  .libs\/phalcon.o    -march=native -mtune=native -O2   -Wl,-soname -Wl,phalcon.so -o .libs\/phalcon.so\r\nlibtool: link: ( cd \".libs\" &amp;&amp; rm -f \"phalcon.la\" &amp;&amp; ln -s \"..\/phalcon.la\" \"phalcon.la\" )\r\n\/bin\/bash \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/libtool --mode=install cp .\/phalcon.la \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/modules\r\nlibtool: install: cp .\/.libs\/phalcon.so \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/modules\/phalcon.so\r\nlibtool: install: cp .\/.libs\/phalcon.lai \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/modules\/phalcon.la\r\nlibtool: finish: PATH=\"\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/snap\/bin:\/sbin\" ldconfig -n \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/modules\r\n----------------------------------------------------------------------\r\nLibraries have been installed in:\r\n   \/home\/teddy\/Documents\/cpp\/cphalcon\/build\/php5\/64bits\/modules\r\n\r\nIf you ever happen to want to link against installed libraries\r\nin a given directory, LIBDIR, you must either use libtool, and\r\nspecify the full pathname of the library, or use the `-LLIBDIR'\r\nflag during linking and do at least one of the following:\r\n   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable\r\n     during execution\r\n   - add LIBDIR to the `LD_RUN_PATH' environment variable\r\n     during linking\r\n   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag\r\n   - have your system administrator add LIBDIR to `\/etc\/ld.so.conf'\r\n\r\nSee any operating system documentation about shared libraries for\r\nmore information, such as the ld(1) and ld.so(8) manual pages.\r\n----------------------------------------------------------------------\r\n\r\nBuild complete.\r\nDon't forget to run 'make test'.\r\n\r\nInstalling shared extensions:     \/usr\/lib\/php\/20131226\/\r\nInstalling header files:           \/usr\/include\/php\/20131226\/\r\n\r\nThanks for compiling Phalcon!\r\nBuild succeed: Please restart your web server to complete the installation<\/pre>\n<p>OK. It takes a while to install it. It recommended to install apache web server.<\/li>\n<li>Then Create phalcon.ini file in \/etc\/php\/5.6\/mods-available\/ directory (because I use php 5.6)\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/cpp\/cphalcon\/build$ sudo gedit \/etc\/php\/5.6\/mods-available\/phalcon.ini<\/pre>\n<p>Then type &#8216;extension=phalcon.so&#8217; (WITHOUT QUOTE!)<br \/>\nThat mean we can use &#8216;phalcon&#8217; in PHP 5.6 ONLY! TO enable the mod in the others php version, we can use the same method!<br \/>\nNo need to use command &#8216;sudo phpenmod phalcon&#8217; anymore!<br \/>\nNOTE: Somehow I can&#8217;t use this command instead of the above<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/cpp\/cphalcon\/build$ sudo echo \"extension=phalcon.so\" &gt;&gt; \/etc\/php\/5.6\/mods-available\/phalcon.ini\r\nbash: \/etc\/php\/5.6\/mods-available\/phalcon.ini: Permission denied<\/pre>\n<p>I also tried to write the extension directly in &#8216;\/etc\/php\/5.6\/apache2\/php.ini&#8217; but apache showed error when trying to restart it!<\/li>\n<li>Then restart the apache web server\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/cpp\/cphalcon\/build$ sudo service apache2 restart\r\n * Restarting Apache httpd web server apache2                              AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\r\n                                                                    [ OK ]<\/pre>\n<p>If there is no error, then check it on php_info()<a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/02\/phalcon-phpinfo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1770\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/02\/phalcon-phpinfo.png\" alt=\"\" width=\"957\" height=\"525\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/02\/phalcon-phpinfo.png 957w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/02\/phalcon-phpinfo-300x165.png 300w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/02\/phalcon-phpinfo-768x421.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a>I CAN ALSO CHECK THE MODULES INSTALLED FROM COMMAND TERMINAL:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Documents\/works\/phalcon\/phalcon-devtools$ php5.6 --modules\r\n[PHP Modules]\r\n...\r\nphalcon\r\n...\r\n<\/pre>\n<p>SO COMPILATION AND INSTALLATION SUCCESS!<br \/>\nTO TRY AND LEARN PHALCON DEEPER (CMS, BLOG, LOGIN, ETC), THIS IS A GOOD COMPILATION:\u00a0<a href=\"https:\/\/github.com\/sergeyklay\/awesome-phalcon\">https:\/\/github.com\/sergeyklay\/awesome-phalcon<\/a>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Reference: https:\/\/phalconphp.com\/en\/download How To Install Phalcon PHP Framework on Ubuntu 14.10, 14.04 &amp; 12.04 Phalcon is a C extension, so you need to download a binary for your platform or compile it from source code (SO INSTALL THE BINARY OR COMPILE! CHOOSE ONLY OF THEM!). Installation on Ubuntu 14.04: Install the binary (the easiest way &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2017\/02\/09\/phalcon-installation-on-ubuntu-14-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Phalcon Compilation and Installation on Ubuntu 14.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59,48,17,18],"tags":[],"class_list":["post-1766","post","type-post","status-publish","format-standard","hentry","category-phalcon","category-php-2","category-ubuntu","category-ubuntu-14-04"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=1766"}],"version-history":[{"count":8,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1766\/revisions"}],"predecessor-version":[{"id":1800,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1766\/revisions\/1800"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=1766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=1766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=1766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}