{"id":414,"date":"2011-02-27T18:12:59","date_gmt":"2011-02-27T10:12:59","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=414"},"modified":"2023-06-27T10:39:35","modified_gmt":"2023-06-27T10:39:35","slug":"how-to-install-php-5-3-on-centos-or-rhel","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-php-5-3-on-centos-or-rhel\/","title":{"rendered":"How to Install php 5.3 on CentOS or RHEL"},"content":{"rendered":"<p>PHP is a popular scripting language that is especially suited to web development. It is fast, flexible, and pragmatic. PHP powers everything from your blog to the most popular websites in the world.<\/p>\n<p>In this tutorial, we will guide you through the process of installing PHP 5.3 on CentOS or RHEL using the Webtatic repository. This tutorial is applicable to both 32-bit and 64-bit versions of CentOS or RHEL.<\/p>\n<h2>Installing Basic PHP Packages<\/h2>\n<p>To begin with, we will install the basic PHP packages. This can be done using the following command:<\/p>\n<pre>\r\nyum --enablerepo=webtatic install php\r\n<\/pre>\n<p>This command will enable the Webtatic repository and install the PHP package. The output will show the installation process, including the resolution of dependencies, the transaction check, and the installation of the PHP package and its dependencies.<\/p>\n<pre>\r\n[root@server \/]# yum --enablerepo=webtatic install php\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * addons: ftp.oss.eznetsols.org\r\n * base: ftp.oss.eznetsols.org\r\n * extras: ftp.oss.eznetsols.org\r\n * updates: ftp.oss.eznetsols.org\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package php.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n--> Processing Dependency: php-cli = 5.3.5-1.1.w5 for package: php\r\n--> Processing Dependency: php-common = 5.3.5-1.1.w5 for package: php\r\n--> Running transaction check\r\n---> Package php-cli.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-common.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n--> 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                x86_64         5.3.5-1.1.w5          webtatic         1.3 M\r\nInstalling for dependencies:\r\n php-cli            x86_64         5.3.5-1.1.w5          webtatic         2.5 M\r\n php-common         x86_64         5.3.5-1.1.w5          webtatic         567 k\r\n\r\nTransaction Summary\r\n================================================================================\r\nInstall       3 Package(s)\r\nUpgrade       0 Package(s)\r\n\r\nTotal download size: 4.3 M\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/3): php-common-5.3.5-1.1.w5.x86_64.rpm                | 567 kB     00:00\r\n(2\/3): php-5.3.5-1.1.w5.x86_64.rpm                       | 1.3 MB     00:00\r\n(3\/3): php-cli-5.3.5-1.1.w5.x86_64.rpm                   | 2.5 MB     00:00\r\n--------------------------------------------------------------------------------\r\nTotal                                           8.8 MB\/s | 4.3 MB     00:00\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing     : php-common                                               1\/3\r\n  Installing     : php-cli                                                  2\/3\r\n  Installing     : php                                                      3\/3\r\n\r\nInstalled:\r\n  php.x86_64 0:5.3.5-1.1.w5\r\n\r\nDependency Installed:\r\n  php-cli.x86_64 0:5.3.5-1.1.w5         php-common.x86_64 0:5.3.5-1.1.w5\r\n\r\nComplete!\r\n<\/pre>\n<h2>Installing PHP Packages for MySQL Integration and phpMyAdmin Management<\/h2>\n<p>Next, we will install the PHP packages that will integrate with MySQL and will be managed through phpMyAdmin. This can be done using the following command:<\/p>\n<pre>\r\nyum --enablerepo=webtatic install php php-mbstring php-common php-pdo php-mysql php-cli php-mcrypt php-gd\r\n<\/pre>\n<p>This command will install several PHP packages, including php-mbstring, php-common, php-pdo, php-mysql, php-cli, php-mcrypt, and php-gd. The output will show the installation process, including the resolution of dependencies, the transaction check, and the installation of the PHP packages.<\/p>\n<pre>\r\n[root@server \/]# yum --enablerepo=webtatic install php php-mbstring php-common \r\nphp-pdo php-mysql php-cli php-mcrypt php-gd\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * addons: ftp.oss.eznetsols.org\r\n * base: ftp.oss.eznetsols.org\r\n * extras: ftp.oss.eznetsols.org\r\n * updates: ftp.oss.eznetsols.org\r\naddons                                                   |  951 B     00:00\r\nbase                                                     | 2.1 kB     00:00\r\nextras                                                   | 2.1 kB     00:00\r\nupdates                                                  | 1.9 kB     00:00\r\nwebtatic                                                 |  951 B     00:00\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package php.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-cli.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-common.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-gd.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-mbstring.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-mcrypt.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-mysql.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n---> Package php-pdo.x86_64 0:5.3.5-1.1.w5 set to be updated\r\n--> 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                 x86_64        5.3.5-1.1.w5           webtatic        1.3 M\r\n php-cli             x86_64        5.3.5-1.1.w5           webtatic        2.5 M\r\n php-common          x86_64        5.3.5-1.1.w5           webtatic        567 k\r\n php-gd              x86_64        5.3.5-1.1.w5           webtatic        107 k\r\n php-mbstring        x86_64        5.3.5-1.1.w5           webtatic        1.2 M\r\n php-mcrypt          x86_64        5.3.5-1.1.w5           webtatic         30 k\r\n php-mysql           x86_64        5.3.5-1.1.w5           webtatic         90 k\r\n php-pdo             x86_64        5.3.5-1.1.w5           webtatic         64 k\r\n\r\nTransaction Summary\r\n================================================================================\r\nInstall       8 Package(s)\r\nUpgrade       0 Package(s)\r\n\r\nTotal download size: 5.7 M\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/8): php-mcrypt-5.3.5-1.1.w5.x86_64.rpm                |  30 kB     00:00\r\n(2\/8): php-pdo-5.3.5-1.1.w5.x86_64.rpm                   |  64 kB     00:00\r\n(3\/8): php-mysql-5.3.5-1.1.w5.x86_64.rpm                 |  90 kB     00:00\r\n(4\/8): php-gd-5.3.5-1.1.w5.x86_64.rpm                    | 107 kB     00:00\r\n(5\/8): php-common-5.3.5-1.1.w5.x86_64.rpm                | 567 kB     00:00\r\n(6\/8): php-mbstring-5.3.5-1.1.w5.x86_64.rpm              | 1.2 MB     00:00\r\n(7\/8): php-5.3.5-1.1.w5.x86_64.rpm                       | 1.3 MB     00:00\r\n(8\/8): php-cli-5.3.5-1.1.w5.x86_64.rpm                   | 2.5 MB     00:00\r\n--------------------------------------------------------------------------------\r\nTotal                                           8.2 MB\/s | 5.7 MB     00:00\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing     : php-common                                               1\/8\r\n  Installing     : php-cli                                                  2\/8\r\n  Installing     : php-pdo                                                  3\/8\r\n  Installing     : php-mcrypt                                               4\/8\r\n  Installing     : php-mbstring                                             5\/8\r\n  Installing     : php                                                      6\/8\r\n  Installing     : php-mysql                                                7\/8\r\n  Installing     : php-gd                                                   8\/8\r\n\r\nInstalled:\r\n  php.x86_64 0:5.3.5-1.1.w5               php-cli.x86_64 0:5.3.5-1.1.w5\r\n  php-common.x86_64 0:5.3.5-1.1.w5        php-gd.x86_64 0:5.3.5-1.1.w5\r\n  php-mbstring.x86_64 0:5.3.5-1.1.w5      php-mcrypt.x86_64 0:5.3.5-1.1.w5\r\n  php-mysql.x86_64 0:5.3.5-1.1.w5         php-pdo.x86_64 0:5.3.5-1.1.w5\r\n\r\nComplete!\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum &#8211;enablerepo=webtatic install php<\/span> \u2013 This command enables the Webtatic repository and installs the PHP package.<\/li>\n<li><span class=\"fw-bold\">yum &#8211;enablerepo=webtatic install php php-mbstring php-common php-pdo php-mysql php-cli php-mcrypt php-gd<\/span> \u2013 This command installs several PHP packages that integrate with MySQL and can be managed through phpMyAdmin.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Installing PHP 5.3 on CentOS or RHEL using the Webtatic repository is a straightforward process that involves enabling the repository and using the yum command to install the necessary packages. This tutorial has provided step-by-step instructions for this process, as well as explanations of the commands used. By following these steps, you can successfully install PHP 5.3 on your CentOS or RHEL server and begin developing dynamic web content.<\/p>\n<p>Remember, it&#8217;s important to keep your PHP installation and other server software up-to-date to ensure you have the latest features and security updates.<\/p>\n<p>Whether you&#8217;re using a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS<\/a>, or <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud<\/a> hosting, keeping your server software up-to-date is a crucial part of maintaining a secure and efficient server environment.<\/p>\n<p>We hope this tutorial has been helpful in guiding you through the process of installing PHP 5.3 on CentOS or RHEL.<\/p>\n<p>If you have any further questions or need additional help, feel free to reach out.<\/p>\n<p>Happy coding!<\/p>\n<h2>FAQ<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of installing PHP on CentOS or RHEL?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">PHP is a popular scripting language used in web development. By installing PHP on CentOS or RHEL, you enable your server to process PHP scripts, which can be used to create dynamic content on your websites or applications.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the Webtatic repository?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The Webtatic EL yum repository is a CentOS\/RHEL repository that provides updated web-related packages. It includes the latest versions of packages like PHP, MySQL, among others, which are often more current than those included in CentOS and RHEL distributions.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Why do we need to install additional PHP packages like php-mbstring, php-common, php-pdo, php-mysql, php-cli, php-mcrypt, and php-gd?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">These additional PHP packages provide extra functionalities. For example, php-mbstring provides multibyte specific string functions, php-mysql provides MySQL database server access, php-mcrypt provides encryption capabilities, php-gd provides image processing capabilities, and so on. These packages enhance the capabilities of your PHP installation, allowing you to create more complex and feature-rich applications.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is phpMyAdmin and why is it mentioned in this tutorial?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">phpMyAdmin is a free and open-source tool written in PHP, intended to handle the administration of MySQL or MariaDB with the use of a web browser. It can perform various tasks such as managing databases, tables, columns, relations, indexes, users, permissions, and so on. In this tutorial, it is mentioned because the PHP packages installed will be managed through phpMyAdmin.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the &#8211;enablerepo=webtatic option do in the yum command?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8211;enablerepo=webtatic option in the yum command enables the Webtatic repository for that particular yum command. This allows yum to install packages from the Webtatic repository, which often contains more current versions of web-related packages than the default CentOS or RHEL repositories.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>PHP is a popular scripting language that is especially suited to web development. It is fast, flexible, and pragmatic. PHP powers everything from your blog to the most popular websites&#8230;<\/p>\n","protected":false},"author":6,"featured_media":323,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,2058],"tags":[1975,1536,1646],"class_list":["post-414","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-rhel","tag-install","tag-linux","tag-php"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/414","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=414"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/323"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}