{"id":972,"date":"2014-12-03T22:49:22","date_gmt":"2014-12-03T22:49:22","guid":{"rendered":"http:\/\/www.plugged.in\/?p=972"},"modified":"2014-12-03T22:49:22","modified_gmt":"2014-12-03T22:49:22","slug":"build-php5-6-on-centos-6-6-with-mssql-support","status":"publish","type":"post","link":"https:\/\/www.veriteknik.net.tr\/en\/build-php5-6-on-centos-6-6-with-mssql-support\/","title":{"rendered":"PHP5.6.3 on CentOS 6.6 with MSSQL Support"},"content":{"rendered":"<p>Most of the yum repos doesn&#8217;t include PHP5.6.X on current releases for the time being. So if you need PHP5.6.X, you need to compile and build it for your self.<\/p>\n<p>Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you install the compiled version to your server, consider shutting down your apache server for a while.<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">yum erase php*<\/pre>\n<p>Before downloading the code, install &#8220;Development Tools&#8221; by tiping:<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">yum groupinstall \"Development Tools\"<\/pre>\n<p>and install other related header files:<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">yum install httpd-devel libtool-ltdl-devel libxml2-devel openssl-devel pcre-devel curl-devel gd-devel mysql-devel libxslt-devel<\/pre>\n<p>Download &amp; install libmcrypt<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">wget http:\/\/downloads.sourceforge.net\/project\/mcrypt\/Libmcrypt\/2.5.8\/libmcrypt-2.5.8.tar.gz\n   10  tar zxvf libmcrypt-2.5.8.tar.gz \n   11  cd libmcrypt-2.5.8\n   12  .\/configure \n   13  make\n   14  make install<\/pre>\n<p>Download FreeTDS source, don&#8217;t use yum to install freetds-devel!<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">wget ftp:\/\/ftp.freetds.org\/pub\/freetds\/current\/freetds-current.tar.gz\ntar zxvf freetds-stable.tgz\ncd freetds-0.91\/ #in my case\n.\/configure --prefix=\/usr\/local\/freetds --enable-msdblib\nmake\nmake install\ncp include\/tds.h \/usr\/local\/freetds\/include\ncp src\/tds\/.libs\/libtds.a \/usr\/local\/freetds\/lib\necho \"\/usr\/local\/freetds\/lib\" &gt;&gt; \/etc\/ld.so.conf\necho \"export FREETDSCONF=\/usr\/local\/freetds\/etc\/freetds.conf\" &gt;&gt; \/etc\/profile\nln -s \/usr\/local\/freetds\/lib \/usr\/local\/freetds\/lib64<\/pre>\n<p>Download &amp; extract php 5.6.3 release:<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">wget http:\/\/php.net\/get\/php-5.6.3.tar.gz\/from\/this\/mirror\nmv mirror php-5.6.3.tar.gz\ntar zxvf php-5.6.3.tar.gz\ncd php-5.6.3\n.\/configure \\\n        --with-apxs2 \\\n        --with-curl=\/usr\/local\/lib \\\n        --with-gd \\\n        --with-gettext \\\n        --with-jpeg-dir=\/usr\/local\/lib \\\n        --with-freetype-dir=\/usr\/local\/lib \\\n        --with-kerberos \\\n        --with-openssl \\\n        --with-mhash \\\n        --with-mcrypt \\\n        --with-mysql=\/usr \\\n        --with-mysqli=\/usr\/bin\/mysql_config \\\n        --with-pdo-mysql=\/usr \\\n        --with-pcre-regex=\/usr \\\n        --with-pear \\\n        --with-png-dir=\/usr\/local\/lib \\\n        --with-xsl \\\n        --with-zlib \\\n        --with-zlib-dir=\/usr\/local\/lib \\\n        --with-iconv \\\n        --enable-bcmath \\\n        --enable-calendar \\\n        --enable-exif \\\n        --enable-ftp \\\n        --enable-gd-native-ttf \\\n        --enable-soap \\\n        --enable-sockets \\\n        --enable-mbstring \\\n        --enable-zip \\\n        --enable-wddx \\\n        --with-libdir=lib64 \\\n        --with-mssql=\/usr\/local\/freetds<\/pre>\n<p>Make &amp; Install by typing:<\/p>\n<pre class=\"brush: shell; gutter: true; first-line: 1\">make\nmake install\ncp php.ini-production \/etc\/php.ini\nsed -i 's\/;date.timezone =.*\/  date.timezone = \"Europe\/Istanbul\"\/' \/etc\/php.ini<\/pre>\n<p>Don&#8217;t forget to add respective extension to httpd.conf:<\/p>\n<pre>echo \"AddType application\/x-httpd-php .php\" &gt;&gt; \/etc\/httpd\/conf.d\/php.conf\necho \"AddType application\/x-httpd-php-source .phps\" &gt;&gt; \/etc\/httpd\/conf.d\/php.conf<\/pre>\n<p>and a final configuration:<\/p>\n<pre>sed -i 's\/DirectoryIndex index.html.*\/  DirectoryIndex index.html index.html.var index.php\/' \/etc\/httpd\/conf\/httpd.conf<\/pre>\n<p>please let us know if you find any mistake<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the yum repos doesn&#8217;t include PHP5.6.X on current releases for the time being. So if you need PHP5.6.X, you need to compile and build it for your self. Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[370,416],"tags":[366,414,415,375,417,418],"yst_prominent_words":[939,937,897,936,938,337,855],"class_list":["post-972","post","type-post","status-publish","format-standard","hentry","category-linux","category-php-programming","tag-centos","tag-freetds","tag-mssql","tag-php","tag-php-5-6","tag-php-5-6-3"],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"ckaraca","author_link":"https:\/\/www.veriteknik.net.tr\/en\/author\/ckaraca\/"},"uagb_comment_info":0,"uagb_excerpt":"Most of the yum repos doesn&#8217;t include PHP5.6.X on current releases for the time being. So if you need PHP5.6.X, you need to compile and build it for your self. Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you&hellip;","_links":{"self":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/comments?post=972"}],"version-history":[{"count":0,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/972\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/media?parent=972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/categories?post=972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/tags?post=972"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}