{"id":23253,"date":"2024-03-16T01:05:30","date_gmt":"2024-03-16T01:05:30","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/"},"modified":"2024-03-22T00:49:34","modified_gmt":"2024-03-22T00:49:34","slug":"setting-up-an-environment-with-windows-iis-php-and-mysql","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/","title":{"rendered":"Setting up an environment with Windows, IIS, PHP, and MySQL."},"content":{"rendered":"<p>To set up an IIS+PHP+MySQL environment on Windows, you can follow these steps:<\/p>\n<ol>\n<li>Install IIS:<\/li>\n<li>Open the &#8220;Control Panel&#8221;, select &#8220;Programs&#8221;, and click on &#8220;Enable or disable Windows features&#8221;.<\/li>\n<li>Check the box next to &#8220;Web Management Tools&#8221;, &#8220;World Wide Web Services&#8221;, and &#8220;ISAPI Extensions&#8221; under &#8220;Internet Information Services&#8221;.<\/li>\n<li>Click on &#8220;OK&#8221; to proceed with the installation.<\/li>\n<li>Installing PHP:<\/li>\n<li>Download the Windows version of PHP, for example, from the official website php.net.<\/li>\n<li>Extract the downloaded PHP compressed file and move the extracted folder to the directory of IIS, for example move it to &#8220;C:\\inetpub\\wwwroot\\php&#8221;.<\/li>\n<li>Rename the &#8220;php.ini-development&#8221; file to &#8220;php.ini&#8221; in the PHP directory.<\/li>\n<li>Edit the &#8220;php.ini&#8221; file and modify the following configurations:\n<p>Change &#8220;;extension_dir = \u201cext\u201d&#8221; to &#8220;extension_dir = \u201cC:\\inetpub\\wwwroot\\php\\ext\u201d&#8221;.<br \/>\nChange &#8220;;cgi.force_redirect = 1&#8221; to &#8220;cgi.force_redirect = 0&#8221;.<br \/>\nChange &#8220;;cgi.fix_pathinfo=1&#8221; to &#8220;cgi.fix_pathinfo=0&#8221;.<br \/>\nChange &#8220;;date.timezone = \u201d to &#8220;date.timezone = Asia\/Shanghai&#8221; (or modify according to your time zone).<\/li>\n<li>Set up IIS.<\/li>\n<li>Open the &#8220;Control Panel&#8221;, choose &#8220;System and Security&#8221;, click on &#8220;Administrative Tools&#8221;, and open &#8220;Internet Information Services (IIS) Manager&#8221;.<\/li>\n<li>In the tree menu on the left, expand the server name, right-click on &#8220;Website&#8221;, and select &#8220;Add Website&#8221;.<\/li>\n<li>In the &#8220;Add Website&#8221; dialogue box, enter the website name and set the physical path to the folder where PHP is located (such as &#8220;C:\\inetpub\\wwwroot\\php&#8221;).<\/li>\n<li>In the &#8220;Binding&#8221; tab, select the IP address and port number (default is 80).<\/li>\n<li>Click &#8220;OK&#8221; to finish configuring the website.<\/li>\n<li>Install MySQL.<\/li>\n<li>Download the Windows version of MySQL, for example, from the official website mysql.com.<\/li>\n<li>Run the installation program, follow the instructions to install MySQL, and set the password for the root user.<\/li>\n<li>Set up MySQL<\/li>\n<li>Open the &#8220;my.ini&#8221; file under the MySQL installation directory.<\/li>\n<li>Locate the section &#8220;[mysqld]&#8221; and add a line &#8220;default-character-set=utf8&#8221;.<\/li>\n<li>Locate the &#8220;[client]&#8221; section and add a line &#8220;default-character-set=utf8&#8221;.<\/li>\n<li>Save and close the &#8220;my.ini&#8221; file.<\/li>\n<li>Login to MySQL by entering &#8220;mysql -u root -p&#8221; in the Windows command prompt.<\/li>\n<li>Enter the password of the root user to access the MySQL command line interface.<\/li>\n<li>To create a new database, run the following command: CREATE DATABASE example;<br \/>\nGrant all privileges on the &#8216;example&#8217; database to &#8216;username&#8217;@&#8217;localhost&#8217; with the password &#8216;password&#8217;;<br \/>\nFlush privileges.<\/li>\n<li>Test environment:<\/li>\n<li>Create a test file in the website directory of IIS, for example &#8220;C:\\inetpub\\wwwroot\\test.php&#8221;.<\/li>\n<li>Enter the following content in the &#8220;test.php&#8221; file to test:\n<p><?php\nphpinfo();\n?><\/li>\n<li>Access the test file by typing &#8220;http:\/\/localhost\/test.php&#8221; into the web browser to ensure that both PHP and MySQL are functioning correctly.<\/li>\n<\/ol>\n<p>In this way, the configuration of setting up IIS+PHP+MySQL environment on Windows is completed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To set up an IIS+PHP+MySQL environment on Windows, you can follow these steps: Install IIS: Open the &#8220;Control Panel&#8221;, select &#8220;Programs&#8221;, and click on &#8220;Enable or disable Windows features&#8221;. Check the box next to &#8220;Web Management Tools&#8221;, &#8220;World Wide Web Services&#8221;, and &#8220;ISAPI Extensions&#8221; under &#8220;Internet Information Services&#8221;. Click on &#8220;OK&#8221; to proceed with the [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-23253","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setting up an environment with Windows, IIS, PHP, and MySQL. - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting up an environment with Windows, IIS, PHP, and MySQL.\" \/>\n<meta property=\"og:description\" content=\"To set up an IIS+PHP+MySQL environment on Windows, you can follow these steps: Install IIS: Open the &#8220;Control Panel&#8221;, select &#8220;Programs&#8221;, and click on &#8220;Enable or disable Windows features&#8221;. Check the box next to &#8220;Web Management Tools&#8221;, &#8220;World Wide Web Services&#8221;, and &#8220;ISAPI Extensions&#8221; under &#8220;Internet Information Services&#8221;. Click on &#8220;OK&#8221; to proceed with the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-16T01:05:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-22T00:49:34+00:00\" \/>\n<meta name=\"author\" content=\"Liam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Liam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\"},\"author\":{\"name\":\"Liam\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/23786905eb7b377f45ddb01c17da7671\"},\"headline\":\"Setting up an environment with Windows, IIS, PHP, and MySQL.\",\"datePublished\":\"2024-03-16T01:05:30+00:00\",\"dateModified\":\"2024-03-22T00:49:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\"},\"wordCount\":462,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\",\"name\":\"Setting up an environment with Windows, IIS, PHP, and MySQL. - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2024-03-16T01:05:30+00:00\",\"dateModified\":\"2024-03-22T00:49:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting up an environment with Windows, IIS, PHP, and MySQL.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/23786905eb7b377f45ddb01c17da7671\",\"name\":\"Liam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8d37ed3e7f770dde8bf069ba0b4298688028c3abaacf1131742fc1352d174ebd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8d37ed3e7f770dde8bf069ba0b4298688028c3abaacf1131742fc1352d174ebd?s=96&d=mm&r=g\",\"caption\":\"Liam\"},\"sameAs\":[\"http:\/\/Wilson\"],\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/liamwilson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Setting up an environment with Windows, IIS, PHP, and MySQL. - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/","og_locale":"en_US","og_type":"article","og_title":"Setting up an environment with Windows, IIS, PHP, and MySQL.","og_description":"To set up an IIS+PHP+MySQL environment on Windows, you can follow these steps: Install IIS: Open the &#8220;Control Panel&#8221;, select &#8220;Programs&#8221;, and click on &#8220;Enable or disable Windows features&#8221;. Check the box next to &#8220;Web Management Tools&#8221;, &#8220;World Wide Web Services&#8221;, and &#8220;ISAPI Extensions&#8221; under &#8220;Internet Information Services&#8221;. Click on &#8220;OK&#8221; to proceed with the [&hellip;]","og_url":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2024-03-16T01:05:30+00:00","article_modified_time":"2024-03-22T00:49:34+00:00","author":"Liam","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Liam","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/"},"author":{"name":"Liam","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/23786905eb7b377f45ddb01c17da7671"},"headline":"Setting up an environment with Windows, IIS, PHP, and MySQL.","datePublished":"2024-03-16T01:05:30+00:00","dateModified":"2024-03-22T00:49:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/"},"wordCount":462,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/","url":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/","name":"Setting up an environment with Windows, IIS, PHP, and MySQL. - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2024-03-16T01:05:30+00:00","dateModified":"2024-03-22T00:49:34+00:00","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/setting-up-an-environment-with-windows-iis-php-and-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Setting up an environment with Windows, IIS, PHP, and MySQL."}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/23786905eb7b377f45ddb01c17da7671","name":"Liam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8d37ed3e7f770dde8bf069ba0b4298688028c3abaacf1131742fc1352d174ebd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8d37ed3e7f770dde8bf069ba0b4298688028c3abaacf1131742fc1352d174ebd?s=96&d=mm&r=g","caption":"Liam"},"sameAs":["http:\/\/Wilson"],"url":"https:\/\/www.silicloud.com\/blog\/author\/liamwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/23253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=23253"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/23253\/revisions"}],"predecessor-version":[{"id":57219,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/23253\/revisions\/57219"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=23253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=23253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=23253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}