{"id":6435,"date":"2016-02-20T17:08:06","date_gmt":"2016-02-20T22:08:06","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=6435"},"modified":"2016-02-20T17:08:06","modified_gmt":"2016-02-20T22:08:06","slug":"install-php-7-on-a-cpanelwhm-server","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/","title":{"rendered":"Install PHP 7 on a cPanel\/WHM Server"},"content":{"rendered":"<p>How to install PHP 7 on a cPanel\/WHM Server<\/p>\n<p><code><br \/>\nmkdir php7.0<br \/>\ncd php7.0<br \/>\nwget http:\/\/php.net\/distributions\/php-7.0.1.tar.gz<br \/>\ntar -xvf php-7.0.1.tar.gz<br \/>\ncd php-7.0.<\/code><br \/>\nRun<br \/>\n<code><br \/>\n.\/configure \u2013help (to see all available options first)<\/p>\n<p>.\/configure  --enable-bcmath --enable-calendar --enable-exif --enable-ftp<br \/>\n--enable-gd-native-ttf --enable-libxml --enable-mbstring --enable-pdo=shared<br \/>\n --enable-sockets --enable-zip --prefix=\/usr\/local\/php70  --with-curl=\/opt\/curlssl\/<br \/>\n --with-freetype-dir=\/usr --with-gd --with-gettext --with-imap=\/opt\/php_with_imap_client\/<br \/>\n--with-imap-ssl=\/usr --with-jpeg-dir=\/usr --with-kerberos --with-libdir=lib64<br \/>\n--with-libxml-dir=\/opt\/xml2\/ --with-mcrypt=\/opt\/libmcrypt\/ --with-mysqli<br \/>\n--with-openssl=\/usr --with-openssl-dir=\/usr --with-pcre-regex=\/opt\/pcre<br \/>\n--with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=\/usr<br \/>\n--with-xpm-dir=\/usr --with-zlib --with-zlib-dir=\/usr<\/p>\n<p>make<br \/>\nmake test<br \/>\nmake install<\/p>\n<p>cd \/usr\/local\/php70\/bin<br \/>\n<\/code><br \/>\nTo see the new version:<\/p>\n<pre>\n.\/php -v\n\nRunning .\/php -v in the \/usr\/local\/php70\/bin folder should give you something like this:\n  \nPHP 7.0.1 (cli) (built: Dec 18 2015 03:53:53) ( NTS )\nCopyright (c) 1997-2015 The PHP Group\nZend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies\n<\/pre>\n<p>Here\u2019s some simple extensions added based on the basic php.ini template<\/p>\n<p><code><br \/>\ncp -f \/usr\/local\/php7.0\/php-7.0.1\/php.ini-production \/usr\/local\/php70\/lib\/php.ini<\/p>\n<p>echo \"extension=pdo.so\" &gt;&gt; \/usr\/local\/php70\/lib\/php.ini<br \/>\necho \"extension=pdo_mysql.so\" &gt;&gt; \/usr\/local\/php70\/lib\/php.ini<br \/>\necho \"zend_extension=opcache.so\" &gt;&gt; \/usr\/local\/php70\/lib\/php.ini<\/code><\/p>\n<p>At this point you can delete the \/usr\/local\/php7.0 folder (the source code)<\/p>\n<p>Now, we need to create a configuration file for apache in order to be able to add the php7 handler so, to do that, open up a new file:<br \/>\n<code>touch \/usr\/local\/apache\/conf\/php7.conf<\/code><br \/>\nand paste the code below. (Don\u2019t forget to modify the \u201cDirectory\u201d path regex to suit your needs.)<\/p>\n<p>        <code>vi \/usr\/local\/apache\/conf\/php7.conf<br \/>\n        &lt;IfModule mod_suphp.c&gt;<br \/>\n            &lt;Directory ~ \"home\/user\/public_html\/\"&gt;<br \/>\n                AddType application\/x-httpd-php7 .php<br \/>\n                suPHP_AddHandler application\/x-httpd-php7<br \/>\n            &lt;\/Directory&gt;<br \/>\n        &lt;\/IfModule&gt;<\/code><\/p>\n<p>To create a new handler in supPHP open up the suphp.conf: <\/p>\n<p><code>vim \/opt\/suphp\/etc\/suphp.conf<\/code><\/p>\n<p>Then add the new handler using the code below, at the end of the handlers list.<\/p>\n<p><code><br \/>\n;Handler for php-scripts<br \/>\n#... existing handlers are here ... put yours below them<br \/>\napplication\/x-httpd-php7=\"php:\/usr\/local\/php70\/bin\/php-cgi\"<br \/>\n<\/code><\/p>\n<p>Now let\u2019s add our handlers into the EasyApache\/cPanel\/WHM configuration without breaking anything&#8230; There are two options here. You either go into WHM and edit the post_virtualhost_global.conf file from there or you just run: <\/p>\n<p><code><br \/>\nvim \/usr\/local\/apache\/conf\/includes\/post_virtualhost_global.conf<br \/>\n<\/code><\/p>\n<p>and add the line below in that file and you should be all done.<\/p>\n<p><code><br \/>\ninclude \/usr\/local\/apache\/conf\/php7.conf<br \/>\n<\/code><\/p>\n<p>Now restart Apache and enjoy!<\/p>\n<p><code><br \/>\nservice httpd restart<br \/>\n<\/code><\/p>\n<p><em>credit: https:\/\/www.codepunker.com\/blog\/how-to-install-php-7-on-a-cpanel-whm-driven-server-without-breaking-everything<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to install PHP 7 on a cPanel\/WHM Server mkdir php7.0 cd php7.0 wget http:\/\/php.net\/distributions\/php-7.0.1.tar.gz tar -xvf php-7.0.1.tar.gz cd php-7.0. Run .\/configure \u2013help (to see all available options first) .\/configure &#8211;enable-bcmath &#8211;enable-calendar &#8211;enable-exif &#8211;enable-ftp &#8211;enable-gd-native-ttf &#8211;enable-libxml &#8211;enable-mbstring &#8211;enable-pdo=shared &#8211;enable-sockets &#8211;enable-zip &#8211;prefix=\/usr\/local\/php70 &#8211;with-curl=\/opt\/curlssl\/ &#8211;with-freetype-dir=\/usr &#8211;with-gd &#8211;with-gettext &#8211;with-imap=\/opt\/php_with_imap_client\/ &#8211;with-imap-ssl=\/usr &#8211;with-jpeg-dir=\/usr &#8211;with-kerberos &#8211;with-libdir=lib64 &#8211;with-libxml-dir=\/opt\/xml2\/ &#8211;with-mcrypt=\/opt\/libmcrypt\/ &#8211;with-mysqli &#8211;with-openssl=\/usr &#8211;with-openssl-dir=\/usr&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-6435","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Install PHP 7 on a cPanel\/WHM Server - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install PHP 7 on a cPanel\/WHM Server - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"How to install PHP 7 on a cPanel\/WHM Server mkdir php7.0 cd php7.0 wget http:\/\/php.net\/distributions\/php-7.0.1.tar.gz tar -xvf php-7.0.1.tar.gz cd php-7.0. Run .\/configure \u2013help (to see all available options first) .\/configure --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=\/usr\/local\/php70 --with-curl=\/opt\/curlssl\/ --with-freetype-dir=\/usr --with-gd --with-gettext --with-imap=\/opt\/php_with_imap_client\/ --with-imap-ssl=\/usr --with-jpeg-dir=\/usr --with-kerberos --with-libdir=lib64 --with-libxml-dir=\/opt\/xml2\/ --with-mcrypt=\/opt\/libmcrypt\/ --with-mysqli --with-openssl=\/usr --with-openssl-dir=\/usr... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-20T22:08:06+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Install PHP 7 on a cPanel\\\/WHM Server\",\"datePublished\":\"2016-02-20T22:08:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/\"},\"wordCount\":190,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/\",\"name\":\"Install PHP 7 on a cPanel\\\/WHM Server - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2016-02-20T22:08:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-php-7-on-a-cpanelwhm-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install PHP 7 on a cPanel\\\/WHM Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install PHP 7 on a cPanel\/WHM Server - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/","og_locale":"en_US","og_type":"article","og_title":"Install PHP 7 on a cPanel\/WHM Server - Linux Shtuff","og_description":"How to install PHP 7 on a cPanel\/WHM Server mkdir php7.0 cd php7.0 wget http:\/\/php.net\/distributions\/php-7.0.1.tar.gz tar -xvf php-7.0.1.tar.gz cd php-7.0. Run .\/configure \u2013help (to see all available options first) .\/configure --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=\/usr\/local\/php70 --with-curl=\/opt\/curlssl\/ --with-freetype-dir=\/usr --with-gd --with-gettext --with-imap=\/opt\/php_with_imap_client\/ --with-imap-ssl=\/usr --with-jpeg-dir=\/usr --with-kerberos --with-libdir=lib64 --with-libxml-dir=\/opt\/xml2\/ --with-mcrypt=\/opt\/libmcrypt\/ --with-mysqli --with-openssl=\/usr --with-openssl-dir=\/usr... Read More","og_url":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2016-02-20T22:08:06+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Install PHP 7 on a cPanel\/WHM Server","datePublished":"2016-02-20T22:08:06+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/"},"wordCount":190,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/","url":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/","name":"Install PHP 7 on a cPanel\/WHM Server - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2016-02-20T22:08:06+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/install-php-7-on-a-cpanelwhm-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Install PHP 7 on a cPanel\/WHM Server"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/6435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=6435"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/6435\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=6435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=6435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=6435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}