{"id":1243,"date":"2014-05-13T00:17:33","date_gmt":"2014-05-13T06:17:33","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=1243"},"modified":"2019-08-26T03:44:49","modified_gmt":"2019-08-26T09:44:49","slug":"installation-of-pecl_http-extension-from-source-code-in-custom-php-in-cloudlinux","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/installation-of-pecl_http-extension-from-source-code-in-custom-php-in-cloudlinux\/","title":{"rendered":"Installation of PECL_HTTP Extension From Source Code in Custom PHP in Cloudlinux"},"content":{"rendered":"<p>Suppose that your Linux server has PHP version selector installed and configured.<\/p>\n<p>As you know alternative php5.x (while using PHP version selector) versions should load \/opt\/alt\/php5x\/etc\/php.ini file and scan \/opt\/alt\/php5x\/etc\/php.d directory for modules::<\/p>\n<p>====<br \/>\nConfiguration File (php.ini) Path \/opt\/alt\/php5x\/etc<br \/>\nLoaded Configuration File \/opt\/alt\/php5x\/etc\/php.ini<br \/>\nScan this dir for additional .ini files \/opt\/alt\/php5x\/etc\/php.d<br \/>\nadditional .ini files parsed \/opt\/alt\/php5x\/etc\/php.d\/alt_php.ini<br \/>\n====<br \/>\nThose are default locations for alt-php.<\/p>\n<p><strong>Steps in installing pecl http package in cloudlinux platform:<\/strong><\/p>\n<p>1. Download the pecl_http package from pecl website http:\/\/pecl.php.net\/package\/pecl_http and compile it.<\/p>\n<p><strong>#wget http:\/\/pecl.php.net\/get\/pecl_http-2.0.4.tgz<\/strong><\/p>\n<p>2. Extract the package<br \/>\n<strong>#tar -xvzf pecl_http-2.0.4.tgz<\/strong><\/p>\n<p>3. Now run the &#8216;phpsize&#8217; command. The phpize command is used to prepare the built environment for a PHP extension<\/p>\n<p><strong>#phpize<\/strong><\/p>\n<p>4. Proceed with the installation of the module as below:<\/p>\n<p><strong>#.\/configure &#8211;with-php-config=\/opt\/alt\/php53\/usr\/bin\/php-config ;<\/strong><br \/>\n<strong># make &amp;&amp; make install<\/strong><\/p>\n<p>Once the above steps are completed, the package pecl-http will be available in the server and we would need to load the extension.<\/p>\n<p>In order to load the Http PHP extension, proceed as below:<\/p>\n<p>1. Create a custom http.ini at location \/opt\/alt\/php5x\/etc\/php.d.all and add the following lines inside that file:<\/p>\n<p><strong>#cd \/opt\/alt\/php5x\/etc\/php.d.all<\/strong><\/p>\n<p><strong>#vi http.ini<\/strong><\/p>\n<p>; Enable http extension module<br \/>\n<em>extension=http.so<\/em><\/p>\n<p>2. The module is loaded via \/opt\/alt\/php53\/etc\/php.d in the cagefs. (CageFS is a virtualized file system and a set of tools to contain each user in its own &#8216;cage&#8217;. Each customer will have its own fully functional CageFS, with all the system files, tools, etc.)<\/p>\n<p>The command cagefsctl &#8211;rebuild-alt-php-ini rebuilds customers alt_php.ini files,<\/p>\n<p><strong># Cagefsctl &#8211;rebuild-alt-php-ini<\/strong><br \/>\nThe location of the file will be \/opt\/alt\/php53\/etc\/php.d\/alt_php.ini<\/p>\n<p>4. Finally, in order to enable the module, restart the webserver<\/p>\n<p><strong>#service httpd restart<\/strong><\/p>\n<p>5. Also, ensure to enable our &#8216;http&#8217; module from WHM as below:<\/p>\n<p>1. Login to WHM and proceed to<br \/>\nHome &gt;&gt;Server Configuration&gt;&gt;CloudLinux LVE Manager<\/p>\n<p>2. Select the &#8216;Selector&#8217; tab<\/p>\n<p>3. Enable the checkbox near the &#8216;http&#8217; module, after selecting the appropriate PHP version from the drop-down menu near &#8216;Choose default modules for&#8217;<\/p>\n<p>Now the PHP-HTTP extension will be available for the PHP version 5.x and we could test the same by creating a sample phpinfo page in any account that uses the php5.x version.<\/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>Suppose that your Linux server has PHP version selector installed and configured. As you know alternative php5.x (while using PHP version selector) versions should load \/opt\/alt\/php5x\/etc\/php.ini file and scan \/opt\/alt\/php5x\/etc\/php.d&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-1243","post","type-post","status-publish","format-standard","hentry","category-general-topics","category-server-tweaking"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1243","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1243"}],"version-history":[{"count":6,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1243\/revisions"}],"predecessor-version":[{"id":4148,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1243\/revisions\/4148"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}