{"id":314,"date":"2011-05-13T00:54:01","date_gmt":"2011-05-13T04:54:01","guid":{"rendered":"http:\/\/blog.shutingg.net\/?p=314"},"modified":"2011-05-13T00:54:01","modified_gmt":"2011-05-13T04:54:01","slug":"deploy-wordpress-on-windows-for-local-testing","status":"publish","type":"post","link":"https:\/\/catsg.link\/blog\/2011\/05\/13\/314\/","title":{"rendered":"Deploy WordPress on Windows for local testing"},"content":{"rendered":"<p>Currently I am playing with WordPress.org. Having a local environment for testing my functions are more convenient. Plus, it won&#8217;t break my blog if I am testing local rather than on the server.    <br \/>I have Windows 7 Professional. And WordPress is developed by PHP with MySQL as database. So I need IIS+PHP+MySQL as testing environment.     <br \/>I have no experience developing PHP. So after going through all the troubles, I think it worth to mark down what I did. <\/p>\n<p>Following are the steps to develop WordPress on Windows locally:<\/p>\n<h2>0. Download necessary files<\/h2>\n<p>  <\/p>\n<p>You need: php, MySql, Eclipse for PHP, WordPress<\/p>\n<h3>Php:   <br \/><\/h3>\n<p>You can download installer of php in:   <br \/><a href=\"http:\/\/windows.php.net\/download\/\">http:\/\/windows.php.net\/download\/<\/a>    <br \/>I recommend downloading the Thread Safe VC9 version if possible. <\/p>\n<h3>MySql:   <br \/><\/h3>\n<p>Download the MSI Installer here:   <br \/><a href=\"http:\/\/www.mysql.com\/downloads\/mysql\/\">http:\/\/www.mysql.com\/downloads\/mysql\/<\/a><\/p>\n<h3>Eclipse for PHP:<\/h3>\n<p>You can choose other IDE if you like, but I love Eclipse because I am familor with it when developing Java. It is free and has lots of plugins. Easy to use.    <br \/><a href=\"http:\/\/www.eclipse.org\/downloads\/\">http:\/\/www.eclipse.org\/downloads\/<\/a><\/p>\n<h3>WordPress:<\/h3>\n<p>I think if you are already hosting WordPress on a server, you should already have the wordpress zip file. If you are just testing WordPress, you can download it on their website:   <br \/><a href=\"http:\/\/wordpress.org\/download\/\">http:\/\/wordpress.org\/download\/<\/a><\/p>\n<h2>1. Install IIS on windows if you have not. <\/h2>\n<p>If you have Windows 7 Professional, Enterprise, or Ultimate, you can install IIS 7.5. By default, IIS 7.5 is not installed on Windows? 7 Professional, Enterprise, or Windows? 7 Ultimate. You can install IIS by clicking Windows Features in Advanced Options under Programs in Control Panel.    <br \/>You can refer to Microsoft&#8217;s website for detail:    <br \/><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc725762.aspx\">http:\/\/technet.microsoft.com\/en-us\/library\/cc725762.aspx<\/a>    <br \/>In Application Development Features, choose all except Server-Side Includes<\/p>\n<p><a href=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image_thumb.png\" width=\"244\" height=\"214\" \/><\/a><\/p>\n<h2>2. Install PHP<\/h2>\n<p>  <\/p>\n<p>Choose FastCGI for server. This is the fastest and most stable option on windows. <\/p>\n<p>You can also refer to <a href=\"http:\/\/www.cenic.cn\/show.aspx?id=209&amp;cid=8\" target=\"_blank\">this document<\/a> for detail. (Note: it is in Chinese)<\/p>\n<h2>3. Configure website folder to test if your PHP works<\/h2>\n<p>  <\/p>\n<p>Start Menu -&gt; Administrative Tools -&gt; Internet Information Services (IIS) Manager   <br \/>Here, you can see FastCGI setting under IIS section.     <br \/>Click Sites -&gt; Default Web Site -&gt; Right Click -&gt; Add Application    <br \/>You will add an alias to your local folder here.     <br \/>Physical Path is the path of your website folder. You can create a test folder and put a testing php file in it.     <br \/>For example, you can put an index.php, with one line of content:    <br \/>&lt;?php phpinfo();?&gt;    <br \/>This will enable you to see your PHP server details.     <br \/>If you give an Alias of yourside, you should be able to visit it by <a href=\"http:\/\/localhost\/yourside\">http:\/\/localhost\/yourside<\/a><\/p>\n<p><a href=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image_thumb1.png\" width=\"244\" height=\"169\" \/><\/a><\/p>\n<h2>4. Create a database for wordpress<\/h2>\n<p>  <\/p>\n<p>Run the MySQL msi file to install MySQL to any folder you like. You may want to set the char set as UTF-8 during installation if your blog is going to display international characters.    <br \/>Run MySQL Command Line Client. Here you will create your database and user for your wordpress blog. Run the following commands:<\/p>\n<p>CREATE DATABASE yourdatabasename;<\/p>\n<p>CREATE USER &#8216;yourusername&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;yourpassword&#8217;;<\/p>\n<p>GRANT ALL PRIVILEGES ON *.* TO &#8216;yourusername&#8217;@&#8217;localhost&#8217;   <br \/>WITH GRANT OPTION;<\/p>\n<h2>5. Get your WordPress code in Eclipse<\/h2>\n<p>  <\/p>\n<p>Unpack the Eclipse zip file.    <br \/>Create a PHP project.     <br \/>Import your WordPress files into the PHP Project.     <br \/>Edit the wp-config.php (or edit wp-config-sample.php and rename it as wp-config.php) by providing database name, username and password.     <br \/>Repeat the Configure website folder steps in section 3 to map an alias to your wordpress folder in eclipse.     <br \/>If you make an alias of blog, you can install wordpress in:    <br \/><a href=\"http:\/\/localhost\/blog\/wp-admin\/install.php\">http:\/\/localhost\/blog\/wp-admin\/install.php<\/a>    <br \/>After simple configuation, you get your WordPress running. You still need to import your WordPress content by Export and Import function of WordPress. <\/p>\n<p>Get to <a title=\"http:\/\/blog.shutingg.net\/wp-admin\/export.php\" href=\"http:\/\/yoursite.net\/wp-admin\/export.php\">http:\/\/yoursite.net\/wp-admin\/export.php<\/a> Click Download Export File. <\/p>\n<p>Then get to your local and import the file. <\/p>\n<p><a href=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image_thumb2.png\" width=\"70\" height=\"244\" \/><\/a><\/p>\n<p>Now you will find that you can also run your php files of WordPress in Eclipse simply by Right click the file -&gt; Run As -&gt; PHP Web Page<\/p>\n<p><a href=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.shutingg.net\/blog\/wp-content\/uploads\/2011\/05\/image_thumb3.png\" width=\"460\" height=\"249\" \/><\/a><\/p>\n<p>Join developing your blog. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Currently I am playing with Wordpress.org. Having a local environment for testing my functions are m\u2026<\/p>\n","protected":false},"author":1,"featured_media":307,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_shuiyun_en_url":"","_shuiyun_en_title":"","_shuiyun_pick":false,"footnotes":""},"categories":[5],"tags":[25],"series":[],"place":[],"class_list":["post-314","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-life","tag-tech","cat-life"],"_links":{"self":[{"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/comments?post=314"}],"version-history":[{"count":0,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/posts\/314\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/media\/307"}],"wp:attachment":[{"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/media?parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/categories?post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/tags?post=314"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/series?post=314"},{"taxonomy":"place","embeddable":true,"href":"https:\/\/catsg.link\/blog\/wp-json\/wp\/v2\/place?post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}