{"id":1377,"date":"2011-07-09T11:58:53","date_gmt":"2011-07-09T15:58:53","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1377"},"modified":"2013-03-20T08:44:21","modified_gmt":"2013-03-20T12:44:21","slug":"howto-install-a-php-fileinfo-module-in-linux","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/howto-install-a-php-fileinfo-module-in-linux","title":{"rendered":"Howto install a PHP FileInfo module in Linux?"},"content":{"rendered":"<p>The <strong>steps to install the PHP &#8216;Fileinfo&#8217; module<\/strong> on a Linux server is as below:<\/p>\n<p><strong>1)<\/strong> Download and untar the package<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># wget http:\/\/pecl.php.net\/get\/Fileinfo-1.0.4.tgz<\/span>\r\n<span style=\"color: #0000ff;\"># tar -zxf Fileinfo-1.0.4.tgz<\/span>\r\n<span style=\"color: #0000ff;\"># cd Fileinfo-1.0.4<\/span><\/pre>\n<\/blockquote>\n<p><strong>2)<\/strong> Generate the extension for compiling<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># phpize<\/span><\/pre>\n<\/blockquote>\n<p><strong>3)<\/strong> Configure the module<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># .\/configure<\/span><\/pre>\n<\/blockquote>\n<p><strong>4)<\/strong> generate the install files and install it<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># make <\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"># make install<\/span><\/pre>\n<\/blockquote>\n<p><strong>5) <\/strong>Now the <strong>extension will be available under the \/usr\/lib64\/php\/modules directory.<\/strong> You now need to add the extension somewhere in the php configuration file.<\/p>\n<p>Edit \/etc\/php.ini and add the following:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">extension=fileinfo.so<\/span><\/pre>\n<\/blockquote>\n<p><strong>6)<\/strong> Save the file and restart the webserver<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># service httpd restart<\/span><\/pre>\n<\/blockquote>\n<p>To verify fileinfo module is enabled properly, execute:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># php -i | grep fileinfo<\/span>\r\nfileinfo support =&gt; enabled<\/pre>\n<\/blockquote>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"text-decoration: underline;\">Alternate method<\/span><\/strong><\/span><\/p>\n<p>Just an FYI, the module can also be installed using the<strong> PECL command<\/strong> i.e.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># pecl install fileinfo<\/span><\/pre>\n<\/blockquote>\n<p>Once done, just follow steps 5 and 6 mentioned above to enable it. That&#8217;s it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The steps to install the PHP &#8216;Fileinfo&#8217; module on a Linux server is as below:<br \/>\n1) Download and untar the package<\/p>\n<p># wget http:\/\/pecl.php.net\/get\/Fileinfo-1.0.4.tgz<br \/>\n# tar -zxf Fileinfo-1.0.4.tgz<br \/>\n# cd Fileinfo-1.0.4<\/p>\n<p>2) Generate the extension for compiling<\/p>\n<p># phpize<\/p>\n<p>3) Configure the module<\/p>\n<p># .\/configure<\/p>\n<p>4) generate the install files and install it<\/p>\n<p># make<br \/>\n# make install<\/p>\n<p>5) Now the extension will be available under the \/usr\/lib64\/php\/modules directory. You now need to add the extension somewhere in the php configuration file.<br \/>\nEdit \/etc\/php.ini and add the following:<\/p>\n<p>extension=fileinfo.so<\/p>\n<p>6) Save the file and restart the webserver<\/p>\n<p># service httpd restart<\/p>\n<p>To verify fileinfo [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1145],"tags":[1260,1261,1263,1262,1258,1257],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1377"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1377"}],"version-history":[{"count":16,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1377\/revisions"}],"predecessor-version":[{"id":2292,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1377\/revisions\/2292"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}