{"id":2075,"date":"2017-08-28T01:05:43","date_gmt":"2017-08-28T07:05:43","guid":{"rendered":"https:\/\/www.supportpro.com\/blog\/?p=2075"},"modified":"2019-10-30T03:02:08","modified_gmt":"2019-10-30T09:02:08","slug":"php-7-for-easyapache3","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/php-7-for-easyapache3\/","title":{"rendered":"PHP 7 for EasyApache3"},"content":{"rendered":"<p>The latest versions of cPanel come with EasyApache 4<\/p>\n<p>which provides a lot of new features like PHP 7 support, native support for multiple PHP versions, etc. So it is recommended to migrate to EasyApache 4 to utilize these features. However, if you cannot migrate EasyApache 4 due to some reason (Example: Tomcat support), you will have to compile the PHP 7 manually from source to use it with EasyApache 3.<\/p>\n<p><!--more--><\/p>\n<p><strong>PHP 7 Manual Installation<\/strong><\/p>\n<p><em>Note: The PHP handler should be SuPHP to get this working.<\/em><\/p>\n<p>1. Download the required PHP-7 distribution Go to <a href=\"http:\/\/php.net\" target=\"_blank\" rel=\"noopener\">php.net<\/a> site to find the latest version.<br \/>\n2. Unpack the downloaded file.<br \/>\n3. Now build it.<\/p>\n<p>In order to compile <a href=\"https:\/\/www.supportpro.com\/blog\/switching-php-versions-an-overlook\/\">PHP<\/a> from source, you should provide the .\/configure options and choose which modules do you want to install.<\/p>\n<p>For example,<\/p>\n<p><em><span style=\"color: orange;\"># .\/configure &#8211;enable-bcmath &#8211;with-bz2 &#8211;enable-calendar &#8211;with-curl &#8211;enable-exif &#8211;enable-ftp &#8211;with-gd &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;enable-gd-native-ttf &#8211;with-imap &#8211;with-imap-ssl &#8211;with-kerberos &#8211;enable-mbstring &#8211;with-mcrypt &#8211;with-mhash &#8211;with-mysql &#8211;with-mysqli &#8211;with-openssl &#8211;with-pdo-mysql &#8211;with-zlib-dir &#8211;with-regex &#8211;enable-sockets &#8211;with-xmlrpc &#8211;enable-zip &#8211;with-zlib &#8211;enable-mbregex &#8211;enable-fpm &#8211;prefix=\/usr\/local\/php<\/span><\/em><\/p>\n<p>The above command will enable basic extensions like FTP, GD, ftp, IMAP, PDO, MySQL etc<\/p>\n<p>Then execute the below commands:<\/p>\n<p><em><span style=\"color: orange;\"># make<\/span><\/em><br \/>\n<em> <span style=\"color: orange;\"># make install<\/span><\/em><\/p>\n<p>4. After compiling from source, copy the default PHP configuration file to the installation directory.<br \/>\n5. Verify the installation:<\/p>\n<p><em><span style=\"color: orange;\"># \/usr\/local\/php70\/bin\/php -v<\/span><\/em><br \/>\n<em> <span style=\"color: orange;\">PHP 7.0.22 (cli) (built: Aug 5 2017 01:56:23) ( NTS )<\/span><\/em><br \/>\n<em> <span style=\"color: orange;\">Copyright (c) 1997-2017 The PHP Group<\/span><\/em><br \/>\n<em> <span style=\"color: orange;\">Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies<\/span><\/em><br \/>\n<em> <span style=\"color: orange;\">with Zend OPcache v7.0.22, Copyright (c) 1999-2017, by Zend Technologies<\/span><\/em><\/p>\n<p>6. Now link our new PHP 7 installation with Apache web server by generating a new PHP config for PHP7 and adding a handler to SuPHP.<br \/>\n7. Add our custom PHP configuration file to EasyApache list so that the changes will not be lost future in EasyApache builds.<br \/>\n8. Restart Apache.<\/p>\n<p>You are done<strong>!<\/strong><\/p>\n<p>In order to configure your website to use PHP7, add the following code to the .htaccess file located within the site&#8217;s document root.<\/p>\n<p><em><span style=\"color: orange;\">AddType application\/x-httpd-php7 .php7 .php<\/span><\/em><\/p>\n<p>Do note that the PHP handler should be <a href=\"https:\/\/www.suphp.org\/\">SuPHP<\/a> for the above steps to work.<\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/www.supportpro.com\/requestquote.php\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The latest versions of cPanel come with EasyApache 4 which provides a lot of new features like PHP 7 support, native support for multiple PHP versions, etc. So it is&hellip;<\/p>\n","protected":false},"author":4,"featured_media":2111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2075","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/2075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=2075"}],"version-history":[{"count":21,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/2075\/revisions"}],"predecessor-version":[{"id":4056,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/2075\/revisions\/4056"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/2111"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=2075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=2075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=2075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}