{"id":1033,"date":"2015-10-17T05:58:21","date_gmt":"2015-10-17T11:58:21","guid":{"rendered":"http:\/\/fallows.ca\/wp\/uncategorized\/wordpress-local-development\/"},"modified":"2016-12-13T19:45:29","modified_gmt":"2016-12-13T19:45:29","slug":"wordpress-local-development","status":"publish","type":"post","link":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/","title":{"rendered":"WordPress Local Development"},"content":{"rendered":"<p><a href=\"http:\/\/fallows.ca\/wp\/wp-content\/uploads\/2016\/12\/netbeans1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"netbeans\" src=\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg\" alt=\"WordPress Local Development\" width=\"616\" height=\"445\" border=\"0\" \/><\/a><\/p>\n<p>If you are interested, here is a short \u201chow to\u201d for setting up a WordPress local development system\u00a0at home. Some tech talk lies ahead, but it is easily accomplished by anyone serious about doing some WordPress programming.<\/p>\n<p><!--more--><\/p>\n<p>In my last article, I described the basics of programming WordPress using a few tools like the NetBeans IDE (integrated development environment) and simple PHP programming. A basic WordPress local development system\u00a0consists of an IDE like NetBeans and a local web server. This article is about setting up a web server on your PC and using it for programming WordPress. Everything described here is open source (free), runs on Windows (as well as Linux and Apple) and widely supported.<\/p>\n<p>There are various packages for setting up a WordPress local development server on your PC. The easiest one I have used is a local install from <a href=\"https:\/\/bitnami.com\/stack\/wordpress\" target=\"_blank\" rel=\"nofollow\">Bitnami<\/a>. Just download and install. You will have your local web server up and running in five minutes.\u00a0 When you run the installation, you enter a user name and password for your WordPress server, as well as a name for your local web site. By local, I mean a web site that runs on your computer and home network, but is not visible to the outside world.<\/p>\n<p>I give my WordPress local development server a pretend web site address, such as \u201ctest.com\u201d. You can call yours anything you want, it doesn\u2019t really matter. In order to access this \u201cpretend web site\u201d, you need to put the information about it into the Windows \u201chosts\u201d file. This file is located in the C:WindowsSystem32driversetc sub-directory. You can edit this file with Notepad as long as you Run As Administrator. You just need to enter the local IP address of your PC as well as the fake web site name. So, for example, my server PC is located at 192.168.0.5 on my home network. The single line I added to the \u201chosts\u201d file is:<\/p>\n<p align=\"center\"><span style=\"color: #008000\">192.168.0.5 \u00a0test.com<\/span><\/p>\n<p>That\u2019s it. You can now access your private WordPress web site from any computer on your LAN using the pretend web address \u201cHTTP:\/\/test.com\u201d in your browser, as long as you modify the hosts file on each computer as described above.<\/p>\n<p>By default, Bitnami installs into a folder on your PC called C:Bitnami. You can access the web site using your browser, and you can also access all of the server files using your normal Windows Explorer.<\/p>\n<h2>WordPress Local Development \u2013 Connecting NetBeans and XDebug<\/h2>\n<p>In order to write code and upload it to your server, you just configure Netbeans so that it knows\u00a0three things:<\/p>\n<ul>\n<li>The name of the folder on your PC where you are going to store your code. This can be a normal Windows folder in My Documents. By default, NetBeans creates a folder for you called \u201cNetBeansProjects\u201d.<\/li>\n<li>The name of the folder in the server where you want to upload your custom code into WordPress. This is normally the WordPress plugins folder. This folder is located within the Bitnami installation under C:Bitnami. Since the server is just a normal file structure on your PC, uploading your custom code is easy. Every time you change your code in NetBeans and save it, a copy is transferred to the server automatically.<\/li>\n<li>The web address of your WordPress local development web site, e.g. \u201cHTTP:\/\/test.com\u201d as described above. This is the web site NetBeans will run while you are developing and debugging your code.<\/li>\n<\/ul>\n<p>Almost there. The last thing you need to do is to activate a program called php_xdebug.dll which included in the Bitnami installation. XDebug is a debugger that you can use to monitor how your custom code runs on the server. This requires adding a few simple lines of instructions in the PHP.INI file in the PHP directory on your server. These lines look like this:<\/p>\n<p><span style=\"color: #008000\">zend_extension=&#8221;C:\/Bitnami\/wordpress-4.3.1-0\/phpextphp_xdebug.dll&#8221;<br \/>\nxdebug.remote_enable=true<br \/>\nxdebug.remote_host=127.0.0.1<br \/>\nxdebug.remote_port=9000<br \/>\nxdebug.remote_connect_back=on<\/span><\/p>\n<p>The first four lines are required to run XDebug. The fifth line is needed if you are connecting to your WordPress Local Development server from any different computer on your LAN. There are many web pages that describe how to set this up in more detail. But it is easy and it works well. After configuring XDebug, you simply run your NetBeans in debug mode and it will monitor the actual performance of your custom PHP and other code in whatever detail you desire. Keep in mind that for any changes to the configuration file to be applied, you must restart your Apache server.<\/p>\n<p>At this point you have set up a completely professional WordPress local development system(IDE, Server, Debugger) in less than half an hour using open-source software. You are now ready to begin coding.<\/p>\n<p>Three last things, especially if you are running your WordPress local development system\u00a0on two different computers. By this I mean using PC A for development and PC B as the server.<\/p>\n<ul>\n<li>First, make sure that port 9000 is open and that your Windows Firewall allows the Bitnami (wordpressApache) server through. Normally, you just need to click \u201cAllow\u201d when the server first runs during the installation.<\/li>\n<li>Second, make sure that your IDE machine (using NetBeans) can upload code to the Server machine. This is easily done by sharing the C:Bitnami folder on PC B server using Windows Homegroup. Make sure that you share this folder with both read and write access so that PC A, your NetBeans machine, can access it.<\/li>\n<li>Thirdly, you need to make sure that XDebug knows the location of where you are storing your custom code on both machines. This is done through an Advanced project configuration feature called Path Mapping. This is only required if you are running on two different computers. Basically, you just map the C:Bitnami\u2026. code path on the server PC to the local My Documents folder on the NetBeans machine. Figuring this out was my biggest stumbling block.<\/li>\n<\/ul>\n<p>You can research more details for yourself. But this article covers the important settings and configurations figured out from my own research and mistakes. Now that you are set up for WordPress local development, it\u2019s time to write and test some code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are interested, here is a short \u201chow to\u201d for setting up a WordPress local development system\u00a0at home. Some tech talk lies ahead, but it is easily accomplished by anyone serious about doing some WordPress programming.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"WordPress Local Development #Bitnami #NetBeans #WordPress #XDebug","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[6],"tags":[132,133,61,134],"series":[],"class_list":["post-1033","post","type-post","status-publish","format-standard","hentry","category-software-projects","tag-bitnami","tag-netbeans","tag-wordpress","tag-xdebug"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WordPress Local Development - Living On The Horizon<\/title>\n<meta name=\"description\" content=\"How to set up a WordPress Local Development Environment with NetBeans, Bitnami and XDebug. Up and running in less than an hour.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress Local Development - Living On The Horizon\" \/>\n<meta property=\"og:description\" content=\"How to set up a WordPress Local Development Environment with NetBeans, Bitnami and XDebug. Up and running in less than an hour.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/\" \/>\n<meta property=\"og:site_name\" content=\"Living On The Horizon\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-17T11:58:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-12-13T19:45:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg\" \/>\n<meta name=\"author\" content=\"John VE6EY\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@VE6EY\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John VE6EY\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/\",\"url\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/\",\"name\":\"WordPress Local Development - Living On The Horizon\",\"isPartOf\":{\"@id\":\"https:\/\/fallows.ca\/wp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg\",\"datePublished\":\"2015-10-17T11:58:21+00:00\",\"dateModified\":\"2016-12-13T19:45:29+00:00\",\"author\":{\"@id\":\"https:\/\/fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945\"},\"description\":\"How to set up a WordPress Local Development Environment with NetBeans, Bitnami and XDebug. Up and running in less than an hour.\",\"breadcrumb\":{\"@id\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#primaryimage\",\"url\":\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg\",\"contentUrl\":\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fallows.ca\/wp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Projects\",\"item\":\"http:\/\/fallows.ca\/wp\/category\/projects\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Software Projects\",\"item\":\"https:\/\/fallows.ca\/wp\/category\/projects\/software-projects\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"WordPress Local Development\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fallows.ca\/wp\/#website\",\"url\":\"https:\/\/fallows.ca\/wp\/\",\"name\":\"Living On The Horizon\",\"description\":\"Blogs and Stuff\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fallows.ca\/wp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945\",\"name\":\"John VE6EY\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fallows.ca\/wp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g\",\"caption\":\"John VE6EY\"},\"sameAs\":[\"https:\/\/x.com\/VE6EY\"],\"url\":\"https:\/\/fallows.ca\/wp\/author\/play\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress Local Development - Living On The Horizon","description":"How to set up a WordPress Local Development Environment with NetBeans, Bitnami and XDebug. Up and running in less than an hour.","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:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/","og_locale":"en_US","og_type":"article","og_title":"WordPress Local Development - Living On The Horizon","og_description":"How to set up a WordPress Local Development Environment with NetBeans, Bitnami and XDebug. Up and running in less than an hour.","og_url":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/","og_site_name":"Living On The Horizon","article_published_time":"2015-10-17T11:58:21+00:00","article_modified_time":"2016-12-13T19:45:29+00:00","og_image":[{"url":"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg","type":"","width":"","height":""}],"author":"John VE6EY","twitter_card":"summary_large_image","twitter_creator":"@VE6EY","twitter_misc":{"Written by":"John VE6EY","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/","url":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/","name":"WordPress Local Development - Living On The Horizon","isPartOf":{"@id":"https:\/\/fallows.ca\/wp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#primaryimage"},"image":{"@id":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#primaryimage"},"thumbnailUrl":"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg","datePublished":"2015-10-17T11:58:21+00:00","dateModified":"2016-12-13T19:45:29+00:00","author":{"@id":"https:\/\/fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945"},"description":"How to set up a WordPress Local Development Environment with NetBeans, Bitnami and XDebug. Up and running in less than an hour.","breadcrumb":{"@id":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#primaryimage","url":"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg","contentUrl":"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2015\/10\/netbeans_thumb1.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/fallows.ca\/wp\/projects\/software-projects\/wordpress-local-development\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fallows.ca\/wp\/"},{"@type":"ListItem","position":2,"name":"Projects","item":"http:\/\/fallows.ca\/wp\/category\/projects\/"},{"@type":"ListItem","position":3,"name":"Software Projects","item":"https:\/\/fallows.ca\/wp\/category\/projects\/software-projects\/"},{"@type":"ListItem","position":4,"name":"WordPress Local Development"}]},{"@type":"WebSite","@id":"https:\/\/fallows.ca\/wp\/#website","url":"https:\/\/fallows.ca\/wp\/","name":"Living On The Horizon","description":"Blogs and Stuff","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fallows.ca\/wp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945","name":"John VE6EY","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fallows.ca\/wp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g","caption":"John VE6EY"},"sameAs":["https:\/\/x.com\/VE6EY"],"url":"https:\/\/fallows.ca\/wp\/author\/play\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6wKKr-gF","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/posts\/1033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/comments?post=1033"}],"version-history":[{"count":1,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/posts\/1033\/revisions"}],"predecessor-version":[{"id":1036,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/posts\/1033\/revisions\/1036"}],"wp:attachment":[{"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/media?parent=1033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/categories?post=1033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/tags?post=1033"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/fallows.ca\/wp\/wp-json\/wp\/v2\/series?post=1033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}