{"id":1449,"date":"2015-02-01T16:29:57","date_gmt":"2015-02-01T14:29:57","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=1449"},"modified":"2017-10-07T17:27:02","modified_gmt":"2017-10-07T15:27:02","slug":"compiling-php-5-6-x","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/compiling-php-5-6-x\/","title":{"rendered":"Compiling PHP 5.6.x"},"content":{"rendered":"<pre class=\"brush:bash shell\">\r\n#See https:\/\/adrhc.go.ro\/wordpress\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here.\r\n#Before starting do declare the environment variables specified to the link above.\r\n\r\nNEW_BUILD_NAME=php\r\nNEW_BUILD_VER1=5.6.13\r\nNEW_BUILD_VER=$NEW_BUILD_VER1-zts\r\nMYSQL_BUILD_NAME_AND_VER=mysql-5.6.25\r\nNEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$MYSQL_BUILD_NAME_AND_VER-$NEW_BUILD_VER\r\nls -l \/tmp\/$NEW_BUILD_NAME-*\r\nls -l ~\/ffp_0.7_armv5\/packages\/$NEW_BUILD_NAME-*\r\nNEW_BUILD_NR=0\r\n\r\ncd ~\/compile\r\nwget -O $NEW_BUILD_NAME_AND_VER.tar.gz http:\/\/ro1.php.net\/get\/php-$NEW_BUILD_VER1.tar.gz\/from\/this\/mirror\r\ntar -xzf $NEW_BUILD_NAME-$NEW_BUILD_VER1.tar.gz\r\nmv $NEW_BUILD_NAME-$NEW_BUILD_VER1 $NEW_BUILD_NAME_AND_VER\r\ncd ~\/compile\/$NEW_BUILD_NAME_AND_VER\r\nnohup ~\/x.sh ffpg &\r\ntail -f nohup.out\r\ncp -r . ..\/$NEW_BUILD_NAME_AND_VER+ffpg\r\n\u00a0\u00a0\r\n#REINSTALL (start from here when reinstalling)\r\ncd ~\/compile\r\nrm -r ~\/compile\/$NEW_BUILD_NAME_AND_VER\r\ncp -r ~\/compile\/$NEW_BUILD_NAME_AND_VER+ffpg ~\/compile\/$NEW_BUILD_NAME_AND_VER\r\ncd ~\/compile\/$NEW_BUILD_NAME_AND_VER\r\n\u00a0\r\n.\/configure --help > configure.help.txt\r\ncat configure.help.txt\r\n\u00a0\r\nERROR0:\r\n\u00a0\u00a0\u00a0\u00a0don't know how to define struct flock on this system ... set --enable-opcache=no\r\nSOLUTION0:\r\n\u00a0\u00a0\u00a0\u00a0funpkg -r libgd-2.1.0-arm-0\r\n\u00a0\r\n#When using --with-apxs2=\/ffp\/opt\/apache-2.2.9-prefork\/bin\/apxs we'll get php-non-ZTS!\r\n#When using --with-apxs2=\/ffp\/opt\/apache-2.2.29-worker\/bin\/apxs we'll get php-ZTS!\r\n#--with-recode -> couldn't build it for the moment\r\n#--with-tidy -> too old, makes no sense to use it\r\n#--without-sqlite3=\/ffp -> doesn't work (stupid option)\r\n#--enable-mysqlnd -> I don't use it\r\n#--enable-dba=shared -> somehow disables mysqli\r\n\r\nsed -i s\/\"HAVE_GD_XPM\\s1\"\/\"HAVE_GD_XPM 0\"\/g configure\r\nsed -i s\/\"lxmlrpc\\s\"\/\"lxmlrpc-epi \"\/g configure\r\n\r\n.\/configure --prefix=\/ffp --enable-re2c-cgoto=shared,\/ffp --with-apxs2=\/ffp\/opt\/apache-2.2.29-worker\/bin\/apxs --enable-fpm --with-config-file-path=\/ffp\/etc\/php.ini --with-config-file-scan-dir=\/ffp\/etc --with-libxml-dir=\/ffp --with-openssl=shared,\/ffp --with-pcre-regex=\/ffp --with-zlib=shared,\/ffp --enable-bcmath --with-bz2=shared,\/ffp --enable-calendar --with-curl=shared,\/ffp --with-enchant=shared,\/ffp --enable-exif --enable-ftp --with-gd=shared,\/ffp --with-jpeg-dir=\/ffp --with-png-dir=\/ffp --with-freetype-dir=\/ffp --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext=shared,\/ffp --with-gmp=shared,\/ffp --with-mhash=shared,\/ffp --enable-intl --with-icu-dir=\/ffp --enable-mbstring --with-mcrypt=shared,\/ffp --with-mysql=shared,\/ffp --with-mysql-sock=\/ffp\/var\/run\/mysql\/mysql.sock --with-mysqli=shared,\/ffp\/bin\/mysql_config --enable-opcache --enable-pcntl --with-pdo-mysql=shared,\/ffp --with-readline=shared,\/ffp --enable-shmop --enable-soap --enable-sockets --enable-wddx --with-libexpat-dir=\/ffp --with-xmlrpc=shared,\/ffp --with-iconv=shared,\/ffp --with-xsl=\/ffp --enable-zip --with-pear --with-pcre-dir=\/ffp --with-openssl-dir=\/ffp --with-zlib-dir=\/ffp --with-iconv-dir=\/ffp\r\n\r\nsed -i s\/\"lxmlrpc\\s\"\/\"lxmlrpc-epi \"\/g Makefile\r\nsed -i s\/\"define\\sHAVE_GD_XPM\\s0\"\/\"undef HAVE_GD_XPM\"\/g main\/php_config.h\r\n\r\n#make\r\nnohup make -C . &\r\nrenice -11 `pidof cc1plus` -p `pidof make` -p `pidof as` -p `pidof ld` -p `pidof configure` -p `pidof cc1`\r\ntail -f nohup.out\r\n#tests\r\nnohup make test &\r\n\r\n#INSTALL\r\nrm -r $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\r\nmkdir -p $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\/ffp\/opt\/apache-2.2.29-worker\/conf\/\r\ncp -v \/ffp\/opt\/apache-2.2.29-worker\/conf\/httpd.conf $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\/ffp\/opt\/apache-2.2.29-worker\/conf\/\r\nINSTALL_ROOT=$HOME\/temp\/$NEW_BUILD_NAME_AND_VER make install\r\n#if after make you are asked for running 'libtool --finish ...' then do it:\r\nlibtool --finish libs\r\n#You'll get something like this:\r\n#Libraries have been installed in:\r\n#   \/ffp\/home\/root\/compile\/$NEW_BUILD_NAME_AND_VER\/libs -> here you'll find libphp5.so and libphp5.la\r\nrm -vr $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\/ffp\/opt\/apache-2.2.29-worker\/conf\/\r\ncd $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\r\nls -l \/tmp\/php-*\r\nls -l ~\/ffp_0.7_armv5\/packages\/php-*\r\n#for the files found below remove the -n or\/and -q php's call options:\r\ngrep -nr \"\\s\\(-q\\|-n\\)\\s\" ffp\/bin\/\r\nsed -i s\/\"\\s-q\"\/\"\"\/ ffp\/bin\/peardev\r\nsed -i s\/\"\\s-q\"\/\"\"\/ ffp\/bin\/pear\r\nsed -i s\/\"\\s-q\"\/\"\"\/ ffp\/bin\/pecl\r\nsed -i s\/\"\\s-n\"\/\"\"\/ ffp\/bin\/pecl\r\nsed -i s\/\"\\!\\\/bin\"\/\"\\!\\\/ffp\\\/bin\"\/ ffp\/bin\/pecl\r\nsed -i s\/\"\\!\\\/bin\"\/\"\\!\\\/ffp\\\/bin\"\/ ffp\/bin\/pear\r\nsed -i s\/\"\\!\\\/bin\"\/\"\\!\\\/ffp\\\/bin\"\/ ffp\/bin\/peardev\r\nmakepkg $NEW_BUILD_NAME-$MYSQL_BUILD_NAME_AND_VER $NEW_BUILD_VER 0\r\ncp -v \/tmp\/php-*.txz $HOME\/ffp_0.7_armv5\/packages\/\r\nfunpkg -i $HOME\/ffp_0.7_armv5\/packages\/$NEW_BUILD_NAME_AND_VER-arm-0.txz\r\n\u00a0\r\n#AFTER INSTALL\r\n#INSTALL PEAR & PECL\r\nwget http:\/\/pear.php.net\/go-pear.phar\r\n#go-pear.phar installs also pecl\r\nphp go-pear.phar\r\n#ERROR (when running go-pear.phar)\r\n\tSHA1 signature could not be verified: broken signature\r\n#SOLUTION\r\n\tDon't modify go-pear.phar with \"~\/x.sh ffpg\" command!!!\r\n\tConfigure php.ini: phar.require_hash = Off.\r\n\tExecute with specific php.ini:\r\n\tphp -c \/ffp\/etc\/php.ini go-pear.phar\r\n\r\n#Modify the following \/ffp\/bin\/ files: pear, peardev, pecl, pecl-gen:\r\n##!\/bin\/sh -> #!\/ffp\/bin\/sh\r\n\r\n#USING PECL: https:\/\/adrhc.go.ro\/wordpress\/using-pecl\/\r\n#USING PEAR: https:\/\/adrhc.go.ro\/wordpress\/using-pear\/\r\n\r\n#ERROR (make)\r\n\tPEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.\r\n#SOLUTION (do it after installing pear)\r\n\tA part of the solution is to at least install PEAR package PHP_Archive.\r\n\tPHP_Archive is required for running phar files (see http:\/\/php.net\/manual\/en\/intro.phar.php).\r\n\r\n#My personal setup:\r\npecl channel-update pecl.php.net\r\npear install --alldeps PHP_Archive-0.11.4\r\npecl install --alldeps --force APCu-4.0.7\r\npecl install --alldeps msgpack-0.5.6\r\npecl install --alldeps --force pthreads-2.0.10\r\n\r\n#INSTALL APCu manually (compile or use https:\/\/adrhc.go.ro\/wordpress\/using-pecl\/)\r\ncd ~\/compile\r\nwget http:\/\/pecl.php.net\/get\/apcu-4.0.7.tgz\r\ntar zxfv apcu-4.0.7.tgz\r\ncd ~\/compile\/apcu-4.0.7\r\nphpize\r\n.\/configure --with-php-config=\/ffp\/bin\/php-config --enable-apcu\r\nmake install\r\n\r\n#dezactiveaza autentificarea in ~\/compile\/apcu-4.0.7\/apc.php: defaults('USE_AUTHENTICATION',0)\r\n#Nu copia apc.php in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/ pt ca deja exista!\r\ncp -v ~\/compile\/apcu-4.0.7\/apc.php $HOME\/tools\/\r\n\r\n#show php modules\r\nphp -m\r\n\u00a0\r\n#Using php5_module with Apache:\r\nLoadModule php5_module \/usr\/local\/zy-pkgs\/lib\/libphp5.so\r\nLink required: \/usr\/local\/zy-pkgs\/php\/php.ini -> \/ffp\/etc\/php.ini\r\nPHPIniDir \/usr\/local\/zy-pkgs\/php\r\nAddHandler php5-script .php\r\nAddType application\/x-httpd-php .php .phtml\r\nAddType application\/x-httpd-php-source .phps\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#See https:\/\/adrhc.go.ro\/wordpress\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here. #Before starting do declare the environment variables specified to the link above. NEW_BUILD_NAME=php NEW_BUILD_VER1=5.6.13 NEW_BUILD_VER=$NEW_BUILD_VER1-zts MYSQL_BUILD_NAME_AND_VER=mysql-5.6.25 NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$MYSQL_BUILD_NAME_AND_VER-$NEW_BUILD_VER ls -l \/tmp\/$NEW_BUILD_NAME-* ls -l ~\/ffp_0.7_armv5\/packages\/$NEW_BUILD_NAME-* NEW_BUILD_NR=0 cd ~\/compile wget [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/compiling-php-5-6-x\/#more-1449\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Compiling PHP 5.6.x<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,11,163],"tags":[112],"class_list":["post-1449","post","type-post","status-publish","format-standard","hentry","category-compiling-from-source","category-linux","category-nsa310","tag-php"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/1449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=1449"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/1449\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=1449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=1449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=1449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}