Do You Localhost Your Wordpress? - Life in the Grid
Total Page:16
File Type:pdf, Size:1020Kb
Do You Localhost Your WordPress? - Life in the Grid http://lifeinthegrid.com/do-you-localhost-your-wordpress/ 137 (http://lifeinthegrid.com Blogosphere (http://lifeinthegrid.com/category/business/blogosphere/), Tools (http://lifeinthegrid.com /category/tech/tools/), Training (http://lifeinthegrid.com/category/tech/training/) /do-you- localhost- Do you do your design/testing/development on your production your-wordpress website? Have you ever installed or updated something that crashes a /#comments) section or the entire site? Ever tried to format or fix your site layout while everyone visiting watches you? If you have spent any amount of time in WordPress you can easily identify with these issues. These issues can easily be avoided by doing development on your own computer. This article will run you through how to get WordPress working on your computer and leave your production site stable, clean and user friendly. Test all your plugins, updates, layout and design ideas on your local computer instead of letting the world watch you. Develop Like a Pro What is XAMPP Installing XAMPP Step by Step Video Instructions New WordPress Install How to Sync your Systems The Duplicator Plugin Quick Overview Administer like a Pro Read Time: 8-10 minutes | Exercises: 15-30 minutes Most people set up their WordPress sites with hosting providers like BlueHost, HostGator, GoDaddy and the big named hosting providers. This is definitely where you want to start and the most affordable solution for getting your site visible to the world. The problem is that most people just stop here. They do all their testing/design/configuration and prototyping directly on their production site and rely on it as a one-stop shop for getting everything done. Now given you have a low traffic site where you are really not trying to commercialize it or take it to the 1 of 50 06/26/15 10:04 AM Do You Localhost Your WordPress? - Life in the Grid http://lifeinthegrid.com/do-you-localhost-your-wordpress/ next level, then the practice of doing everything on a single production server is probably okay. However if you establish good habits now, you will carry them forward to sites that really matter and are no longer just hobby sites. When you begin to build up a decent list of subscribers where people are checking your site regularly and your name and brand is also associated with the reliability of your website, then you should approach every update to your site and database with much more caution and develop like the pros do. I don’t always test my code, but when I do I do it in production. Unemployable Developer… Professional developers work in separate environments. They have two identical blogs on two separate computers. The first is a development environment and the second is a production environment which is usually their hosting provider. The development and production blogs are usually identical to each other except for one huge difference. The development server is only seen by the developer and internal to his/her company and the production server is what the rest of the world sees (usually your hosted server). This is how the pros work and in this article you will learn how to set this environment up for yourself so you can take advantage of all the benefits a development/production environment offers you. Benefits of multiple environments: Design/prototype without affecting your production site Detect plugin conflicts before they happen Avoid unnecessary bandwidth costs Test major upgrades for system stability Debug customer errors in a controlled environment Test new themes widgets and much much more… To have the same functionality that your hosting provider gives you when you set up your production website, you will need the same tools they use to make this happen. Those tools consist of a Web server, database engine, and a scripting language capable of performing complex application requests. Most hosting providers run on Linux operating systems and you will either have a PC or Mac. This scenario is fine, just make sure you’re using close to the same PHP version in both environments. You can easily find this out by pasting the code below into a file named phpinfo.php and then browsing to it, be sure remove to it from your production server when you’re done. There are also WordPress plugins that will output this same info. Just do a search for phpinfo in the plugins directory. 2 of 50 06/26/15 10:04 AM Do You Localhost Your WordPress? - Life in the Grid http://lifeinthegrid.com/do-you-localhost-your-wordpress/ The three big tools that hosting companies use include: Apache, MySQL, and PHP. The beauty of XAMPP is that it bundles all these applications and a few others into an easy to use control panel that allows you to run great applications like WordPress, Joomla, Drupal, and tons of other great open source and commercial products on your own machine. Setting up and installing XAMPP is a simple and easy process. You can have your own WordPress up on your computer in under 15 min! Just follow these simple steps. 3 of 50 06/26/15 10:04 AM Do You Localhost Your WordPress? - Life in the Grid http://lifeinthegrid.com/do-you-localhost-your-wordpress/ 1. DOWNLOAD XAMPP XAMPP for Windows (http://www.apachefriends.org/en/xampp-windows.html) XAMPP for Linux (http://www.apachefriends.org/en/xampp-linux.html) XAMPP for Mac OS X (http://www.apachefriends.org/en/xampp-macosx.html) 2. INSTALL XAMPP Windows Specific Instructions: Disable UAC: During the install, you may get a message indicating that you need to turn off “User Account Control.” This can easily be done by clicking your start button. Type “uac” in the search dialog and choose “Change user account control settings” then set the slider to the very bottom. Install Path: Good: C:\xampp or D:\xampp Bad: C:\Program Files\xampp (xampp does not play well with spaces) Services: These sections don’t need to be checked. Firewall: Click “Allow Access” on all dialogs After Install browse to: http://localhost/ You now have an environment capable of serving up WordPress sites locally. 3. FIND CONTROL PANEL After XAMPP is installed you will need to control XAMPP from it’s control panel. To always have XAMPP showing in your system you need to enable your notifications by clicking customize from the system tray pop-out menu. Then enable XAMPP to show notifications. You can also get to the XAMPP control panel by typing XAMPP from the start menu. The Mac will have similar and probably easier options so look for them after install. As far as the control panel for both operating systems, it is the same. You always want to make sure that Apache and MySQL are running before you can browse to your WordPress site. PHP is built into Apache so you don’t have to worry about starting anything for it. Start MySQL and Apache (see panel above) Browse to Database Editor: http://localhost/phpmyadmin/ (http://localhost/phpmyadmin/) Create a database: “mypress1Ϸ or whatever name you want Create database user: Privileges -> Add a new User 4 of 50 06/26/15 10:04 AM Do You Localhost Your WordPress? - Life in the Grid http://lifeinthegrid.com/do-you-localhost-your-wordpress/ UserName: “superadmin” Host: “localhost” Password: “whateveryouwant” Privileges: Check All Run WordPress Installer: Download WordPress and extract to: C:\xampp\htdocs\mypress1\ your path should be similar Browse to: http://localhost/mypress1/ (http://localhost/mypress1/) Enter database info from above. Finish Installer… Your Done! So you might be asking, “I have a production site and I just ran through installing XAMPP. How do I get the production site onto my local box?” Good thing you asked, I have a handy little plug-in that I wrote that will help you perform this task. Just watch the video below and then download and install the duplicator plug-in (http://lifeinthegrid.com/duplicator) and you’ll be ready to start developing like a pro. If you’re like most WordPress administrator’s you simply update plug-ins and the core of word press on your production site without realizing that these updates are editing core files and core database tables. This is going to work for you 99% of the time but it’s that 1% that could bring your site down 5 of 50 06/26/15 10:04 AM Do You Localhost Your WordPress? - Life in the Grid http://lifeinthegrid.com/do-you-localhost-your-wordpress/ and possibly cause outages for hours. Sometimes I experience people who have had their website down for days by simply installing a plug-in. Individuals who administrate there WordPress sites like professionals have the two-tiered system I mentioned above in the section “Develop like a pro.” The systems don’t have to be 100% in sync; however, they should be somewhat close. So, before you do any upgrades or play with a new plugin simply install it on your development site to make sure everything looks good and you have it configured just how you want and then perform the same action on your production site. Do you Locahost your WordPress? localhost (http://lifeinthegrid.com/tag/localhost/), wordpress (http://lifeinthegrid.com /tag/wordpress/), xampp (http://lifeinthegrid.com/tag/xampp/) Zadli (http://student-site.umm.ac.id) June 11, 2015 at 7:40 pm (http://lifeinthegrid.com/do-you-localhost-your-wordpress/#comment-75810) Wow, this is a great post! Thanks a lot for the information. Reply (/do-you-localhost-your-wordpress/?replytocom=75810#respond) Max April 29, 2015 at 12:02 am (http://lifeinthegrid.com/do-you-localhost-your-wordpress/#comment-74657) This is truly a great plugin, really appreciate your work.