{"id":1901,"date":"2012-02-08T22:30:17","date_gmt":"2012-02-08T14:30:17","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=1901"},"modified":"2023-04-28T09:49:56","modified_gmt":"2023-04-28T09:49:56","slug":"how-to-install-php-mcrypt-on-centos-6-2","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-php-mcrypt-on-centos-6-2\/","title":{"rendered":"How to Install php-mcrypt on CentOS 6.2"},"content":{"rendered":"<p>PHP is a server-side scripting language that is widely used for web development. mcrypt is an encryption library that is used to secure data transmission between the client and server.<\/p>\n<pre>The mcrypt exension is missing. Please check your PHP configuration.<\/pre>\n<p>In this guide, we will show you how to install php-mcrypt on CentOS 6.2.<\/p>\n<h2>Step 1: <\/h2>\n<p>Before installing the php-mcrypt module, make sure you have the EPEL repository installed on your CentOS 6.2 server. If it is not installed, you can install it using the following command:<\/p>\n<pre>\r\nsudo yum install epel-release\r\n<\/pre>\n<h2>Step 2:<\/h2>\n<p>Once the EPEL repository is installed, you can install the php-mcrypt module using the following command:<\/p>\n<pre>\r\nsudo yum install php-mcrypt\r\n<\/pre>\n<p>The output:<\/p>\n<pre>[root@centos62 ~]# yum install php-mcrypt -y\r\nLoaded plugins: fastestmirror\r\nDetermining fastest mirrors\r\nepel\/metalink                                                                | 4.0 kB     00:00\r\n * base: centos.maulvi.net\r\n * epel: mirror01.idc.hinet.net\r\n * extras: centos.maulvi.net\r\n * rpmforge: fr2.rpmfind.net\r\n * updates: centos.maulvi.net\r\nCentOS6.2-Repository                                                         | 4.0 kB     00:00 ...\r\nCentOS6.2-Repository\/primary_db                                              | 3.5 MB     00:00 ...\r\nbase                                                                         | 3.7 kB     00:00\r\nbase\/primary_db                                                              | 3.5 MB     00:33\r\nepel                                                                         | 4.3 kB     00:00\r\nepel\/primary_db                                                              | 3.5 MB     00:40\r\nextras                                                                       | 3.5 kB     00:00\r\nextras\/primary_db                                                            | 6.4 kB     00:00\r\nrpmforge                                                                     | 1.1 kB     00:00\r\nrpmforge\/primary                                                             | 1.5 MB     00:21\r\nrpmforge                                                                                  4248\/4248\r\nupdates                                                                      | 3.5 kB     00:00\r\nupdates\/primary_db                                                           | 1.1 MB     00:13\r\nSetting up Install Process\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package php-mcrypt.i686 0:5.3.3-1.el6 will be installed\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================\r\n Package                   Arch                Version                    Repository           Size\r\n====================================================================================================\r\nInstalling:\r\n php-mcrypt                i686                5.3.3-1.el6                epel                 18 k\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       1 Package(s)\r\n\r\nTotal download size: 18 k\r\nInstalled size: 38 k\r\nDownloading Packages:\r\nphp-mcrypt-5.3.3-1.el6.i686.rpm                                              |  18 kB     00:00\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\nWarning: RPMDB altered outside of yum.\r\n  Installing : php-mcrypt-5.3.3-1.el6.i686                                                      1\/1\r\n\r\nInstalled:\r\n  php-mcrypt.i686 0:5.3.3-1.el6\r\n\r\nComplete!<\/pre>\n<h2>Step 3:<\/h2>\n<p>After the installation is complete, you need to restart the Apache web server to load the new module. You can do this using the following command:<\/p>\n<pre>\r\nsudo service httpd restart\r\n<\/pre>\n<h2>Step 4:<\/h2>\n<p>To verify that the php-mcrypt module is installed correctly, you can create a PHP file with the following content:<\/p>\n<pre>\r\n&lt;?php\r\nphpinfo();\r\n?&gt;\r\n<\/pre>\n<p>Save the file and place it in your web server&#8217;s document root directory, usually \/var\/www\/html\/. Now, open your web browser and go to http:\/\/your_server_ip\/info.php. You should see a page with a lot of information about your PHP installation. Look for the &#8220;mcrypt&#8221; section, and it should say &#8220;enabled&#8221;.<\/p>\n<h2>Commands Mentioned:<\/h2>\n<ul>\n<li><span class=\"fw-bold\">sudo yum install epel-release<\/span> &#8211; installs the EPEL repository<\/li>\n<li><span class=\"fw-bold\">sudo yum install php-mcrypt<\/span> &#8211; installs the php-mcrypt module<\/li>\n<li><span class=\"fw-bold\">sudo service httpd restart<\/span> &#8211; restarts the Apache web server<\/li>\n<\/ul>\n<h2>Conclusion:<\/h2>\n<p>In this guide, we have shown you how to install the php-mcrypt module on CentOS 6.2. This module is essential if you want to encrypt data transmission between the client and server. After following the steps in this guide, you should have successfully installed the php-mcrypt module and verified that it is enabled by creating a PHP file with the phpinfo() function. If you have any comments or suggestions for improvements, please let us know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP is a server-side scripting language that is widely used for web development. mcrypt is an encryption library that is used to secure data transmission between the client and server&#8230;.<\/p>\n","protected":false},"author":6,"featured_media":1554,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,1025],"tags":[1244,1253,1361,1536,1567,1646],"class_list":["post-1901","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-php","tag-centos","tag-centos-6-2","tag-epel","tag-linux","tag-mcrypt","tag-php"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/1901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=1901"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/1901\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1554"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=1901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=1901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=1901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}