{"id":42,"date":"2011-05-01T07:53:54","date_gmt":"2011-05-01T07:53:54","guid":{"rendered":"http:\/\/localhost\/tfcom_wp\/2011\/05\/01\/apache-php-mysql-windows-xp\/"},"modified":"2011-05-01T07:53:54","modified_gmt":"2011-05-01T07:53:54","slug":"apache-php-mysql-windows-xp","status":"publish","type":"post","link":"https:\/\/www.tech-freaks.com\/joomla\/apache-php-mysql-windows-xp.html","title":{"rendered":"Installing Apache, PHP and MySQL for Joomla 2.5x on Windows XP"},"content":{"rendered":"<p style=\"text-align: left;\">The article explains installation of Apache HttpServer, PHP and MySQL on Windows XP without using XAMP, a requisite for installing Joomla 2.5x<\/p>\n<p style=\"text-align: left;\">The article will go through the following steps one by one:<\/p>\n<ul style=\"text-align: left;\">\n<li>Software requirements for Joomla 2.5<\/li>\n<li>Install Apache 2.x and verify<\/li>\n<li>Install PHP and get PHP working<\/li>\n<li>Install MySQL<\/li>\n<li>Verify PHP to MySQL connectivity<\/li>\n<\/ul>\n<p style=\"text-align: left;\">\u00a0<\/p>\n<p><!--more--><\/p>\n<p style=\"text-align: left;\">\u00a0<\/p>\n<p style=\"text-align: left;\"><strong>Software requirements for Joomla 2.5<br \/><\/strong><\/p>\n<p style=\"text-align: left;\">Below are the recommended versions for Joomla 2.5<br \/>PHP\u00a0 5.2+<br \/>Apache 2.x+<br \/>MySQL 5.0.4+<\/p>\n<p style=\"text-align: left;\">\u00a0<\/p>\n<p style=\"text-align: left;\"><strong>Installing Apache 2.x and verify<\/strong><\/p>\n<p style=\"text-align: left;\">Download Apache 2.x from http:\/\/httpd.apache.org\/.<br \/>We are showing installation of HTTP Server 2.2.17.<\/p>\n<p>Click the download installer file to start installation. Click through the initial screens.<\/p>\n<p style=\"text-align: left;\"><img decoding=\"async\" title=\"Apache Installation\" data-src=\"https:\/\/www.tech-freaks.com\/wp-content\/uploads\/2011\/05\/apache_install_wizard.JPG\" alt=\"\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 504px; --smush-placeholder-aspect-ratio: 504\/388;\"><\/p>\n<p style=\"text-align: left;\">Select the typical installation.<\/p>\n<p>We generally prefer a simpler installation path like C:\\Apache2.2\\<\/p>\n<p>Click and move ahead and click the &#8220;Install&#8221;\u00a0button to start.<\/p>\n<p>After the installation is complete, start the server and verify by accessing URL http:\/\/localhost.<\/p>\n<p style=\"text-align: left;\"><img fetchpriority=\"high\" decoding=\"async\" title=\"Apache Successful Installation\" src=\"https:\/\/www.tech-freaks.com\/wp-content\/uploads\/2011\/05\/apache_install_success.JPG\" alt=\"\" width=\"372\" height=\"187\" border=\"0\"><\/p>\n<p style=\"text-align: left;\">The above screen would confirm successful installation of Apache HTTP Server.<\/p>\n<p style=\"text-align: left;\"><strong>Install PHP and get PHP working<\/strong><\/p>\n<p style=\"text-align: left;\">Download PHP from\u00a0<a title=\"PHP for Windows Download\" href=\"http:\/\/windows.php.net\/download\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/windows.php.net\/download\/<\/a><\/p>\n<p>Download the VC6 version. We use the PHP 5.2 version. Download the zip file from this site.<\/p>\n<p>Unzip the downloaded file to a location like &#8220;C:\\php&#8221;.<\/p>\n<p>The php initialization file needs to be configured. This file is present in C:\\php by the name php.ini-recommended. It needs to be renamed as php.ini.<\/p>\n<p>Some modification suggested for a local installation would be:<br \/>short_open_tag = On<br \/>display_errors =\u00a0 On<\/p>\n<p>Modify the extensions directory to point to the correct location.<br \/>extension_dir = &#8220;c:\/php\/ext&#8221;<\/p>\n<p>Modify the session save path to windows like path from \/tmp. Below would be an example:<br \/>session.save_path = &#8220;c:\\tmp&#8221;<\/p>\n<p>Also, to get Apache HTTP Server to be aware about PHP, we need to enable PHP in httpd.conf file located at C:\\Apache2.2\\conf.<\/p>\n<p>Uncomment the below line:<\/p>\n<p>#LoadModule php5_module &#8220;c:\/php\/php5apache2_2.dll&#8221;<\/p>\n<p>To<\/p>\n<p>LoadModule php5_module &#8220;c:\/php\/php5apache2_2.dll&#8221;<\/p>\n<p>Uncomment or add the following line, inside the &lt;IfModule mime_module&gt; section.<\/p>\n<p>AddType application\/x-httpd-php .php<\/p>\n<p>Verify, if you see the file at the location using Windows Explorer. Do not use backslashes.<\/p>\n<p>Also, add the PHP Ini directory as below in the httpd.conf. This needs to be added at the end of the file:<\/p>\n<p>PHPIniDir &#8220;c:\/php&#8221;<\/p>\n<p>Restart Apache HTTP Server for the changes to take effect.<\/p>\n<p>To verify PHP to be functional, create a simple test.php with the following content<\/p>\n<p>&lt;?php phpinfo(); ?&gt;<\/p>\n<p>Save this file to location C:\\Apache2.2\\htdocs. This is the default location in which the server will look<\/p>\n<p>Verify accessing the URL, http:\/\/localhost\/test.php.<\/p>\n<p>A page as provided in the below screenshot should open:<\/p>\n<p><img decoding=\"async\" title=\"PHP success install page\" data-src=\"https:\/\/www.tech-freaks.com\/wp-content\/uploads\/2011\/05\/php_success.jpg\" alt=\"\" width=\"648\" height=\"311\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 648px; --smush-placeholder-aspect-ratio: 648\/311;\"><\/p>\n<p>If this does not work, also add php in the path.<\/p>\n<p>Go to Control Panel &#8211;&gt; System &#8211;&gt; Advanced tab &#8211;&gt; Environment variables, and in system variables, modify the path variable and add &#8220;C:\\php&#8221;\u00a0at the end.<\/p>\n<p style=\"text-align: left;\">\u00a0<\/p>\n<p style=\"text-align: left;\"><strong>Install MySQL<\/strong><\/p>\n<p style=\"text-align: left;\">Download the MySQL community server from 5.5.11 from\u00a0<a title=\"MySQL Download\" href=\"http:\/\/dev.mysql.com\/downloads\/mysql\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/dev.mysql.com\/downloads\/mysql\/<\/a>.<\/p>\n<p>Click on the downloaded installer to install MySQL.<\/p>\n<p>Run through the initial screens and click on the Custom installation.<\/p>\n<p>We recommend using the simple path like C:\\MySQL\\<\/p>\n<p>Click the install button to start installation.<\/p>\n<p>Move ahead to confirm the My SQL Server instance. Ensure to enable starting\/stopping as service, which is a very handy feature.<\/p>\n<p><img decoding=\"async\" title=\"MySQL instance configuration Wizard\" data-src=\"https:\/\/www.tech-freaks.com\/wp-content\/uploads\/2011\/05\/mysql_instance_config.JPG\" alt=\"MySQL instance configuration Wizard\" width=\"504\" height=\"386\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 504px; --smush-placeholder-aspect-ratio: 504\/386;\"><\/p>\n<p>Provide a root password and finish installation.<\/p>\n<p style=\"text-align: left;\">\u00a0<\/p>\n<p style=\"text-align: left;\"><strong>Verify PHP to MySQL connectivity<\/strong><\/p>\n<p style=\"text-align: left;\">This could be one of a painstaking step in this process.<\/p>\n<p>Ensure that you are able to access MySQL instance. Create a new schema as test and create a table test inside it.<\/p>\n<p><img decoding=\"async\" title=\"Test Table Schema\" data-src=\"https:\/\/www.tech-freaks.com\/wp-content\/uploads\/2011\/05\/test_table_schema.JPG\" alt=\"Test Table Schema\" width=\"709\" height=\"580\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 709px; --smush-placeholder-aspect-ratio: 709\/580;\"><\/p>\n<p>Create the table with such a simple columns. Add some values into this table. We will be later writing a simple php file to pull data from this table and display to verify php to mysql connectivity.<\/p>\n<p>However, before reaching this step, you might want to check http:\/\/localhost\/test.php again. Scroll down and try to locate any section for MySQL. This will not be currently present and will have to be enabled.<\/p>\n<p>We need to enable the php extension for mysql connectivity. You will have to again edit c:\/php.ini file which we created earlier.<\/p>\n<p>Look for the php_mysql.dll and uncomment it. Remove the leading ;<\/p>\n<p>extension=php_mysql.dll<\/p>\n<p>Restart apache HTTP Server and again verify http:\/\/localhost\/test.php<\/p>\n<p>Scroll down to locate a MySql section in this page as provided in the screenshot. This would mean that all PHP MySQL connectivity libraries are enabled, so that we can proceed with the testing of PHP and\u00a0MySQL connectivity.<\/p>\n<p><img decoding=\"async\" title=\"PHP MySQL connectivity enabled\" data-src=\"https:\/\/www.tech-freaks.com\/wp-content\/uploads\/2011\/05\/php_mysql_conn_enabled.jpg\" alt=\"PHP MySQL connectivity enabled\" width=\"633\" height=\"451\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 633px; --smush-placeholder-aspect-ratio: 633\/451;\"><br \/>Create a new file in htdoc folder by the name mysql_conn_test.php and add the below code:<\/p>\n<pre style=\"text-align: left;\">\u00a0<\/pre>\n<pre class=\"language-php\"><code>&lt;?php\r\n\r\n# Define MySQL Settings\r\ndefine(\"MYSQL_HOST\", \"localhost\");\r\ndefine(\"MYSQL_USER\", \"root\");\r\ndefine(\"MYSQL_PASS\", \"yourPass\"); \/\/Your root password goes in here\r\ndefine(\"MYSQL_DB\", \"test\");\r\n\r\n$conn = mysql_connect(\"\".MYSQL_HOST.\"\", \"\".MYSQL_USER.\"\", \"\".MYSQL_PASS.\"\") or die(mysql_error());\r\nmysql_select_db(\"\".MYSQL_DB.\"\",$conn) or die(mysql_error());\r\n\r\n$sql = \"SELECT * FROM test\";\r\n$res = mysql_query($sql);\r\n\r\nwhile ($field = mysql_fetch_array($res))\r\n{\r\n$id = $field['id'];\r\n$name = $field['field'];\r\n\r\necho 'ID: ' . $field['id'] . '&lt;br \/&gt;';\r\necho 'Name: ' . $field['field'] . '&lt;br \/&gt;&lt;br \/&gt;';\r\n}\r\n\r\n?&gt;<\/code><\/pre>\n<p style=\"text-align: left;\">Now, try accessing http:\/\/localhost\/ mysql_conn_test.php<\/p>\n<p>If it fetches the content from database, it would mean that we are finally ready to start installation of Joomla 2.5<\/p>\n<p style=\"text-align: left;\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The article explains installation of Apache HttpServer, PHP and MySQL on Windows XP without using XAMP, a requisite for installing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":36,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[4],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-joomla"],"_links":{"self":[{"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":0,"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/media\/36"}],"wp:attachment":[{"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech-freaks.com\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}