04.03.2020

Local Development Environment Setup For Mac

Local Development Environment Setup For Mac 9,2/10 235 reviews
  1. Setup Development Environment Windo…
  2. Windows Development Environment Setup
  3. Mac Development Environment

Also check out. Download Advanced Options for Free Version DO NOT USE THESE DIRECTIONS IF YOU ARE USING THE PRO VERSION Turn On Errors 1. With MAMP running, go to the following page in your browser. Note: if you are using a non standard ports, this link will need to include your port number like this PORT NUMBER./MAMP/index.php?language=English&page=phpinfo 2. Search for “php.ini”. You should see something like Loaded Configuration File: C:/MAMP/bin/php/php5.6.10/conf/php.ini 3. Open the corresponding file in a text editor 4.

Search for the line that says “displayerrors = Off” and change it to “displayerrors = On” 5. Save the file and restart the MAMP servers How To's. Change the password of the MySQL root user Open the Command Prompt and enter the following command line: C:/MAMP/Library/bin/mysqladmin -u root -p password NewPassword replace NewPassword with your new password. Please bear in mind that you also have to change the phpMyAdmin configuration and probably your own php scripts to use the newly created MySQL password.

Windows development environment setup

For changing the phpMyAdmin configuration edit the file C:/MAMP/bin/phpMyAdmin/config.inc.php and up. This allows you to have multiple projects available at the same time NOTE: File locations for Windows Users. C:/Windows/System32/drivers/etc/ (if this is not correct, do a google search for your particular version of windows). C:/MAMP/config/apache/httpd.conf. 0:01 MUSIC. 0:04 Hello and welcome.

0:06 I'm Alena Holligan, a PHP teacher here at Treehouse, and long time developer. 0:11 Most developers prefer to build applications locally,. 0:14 on their own computers, rather than on a hosted server. 0:18 Working locally, allows you to work more quickly. 0:21 Because you don't have to wait for changes to be saved to a remote server. 0:25 And, you don't have to worry about issues, like Internet connectivity. 0:29 Working with files locally also allows tighter integration,.

0:33 with development tools. 0:36 In addition, one of the best things about programming as a career,. 0:39 is the ability to work from anywhere. 0:43 While all these reasons are good, the most important reason for. 0:46 having a local development environment,. 0:49 is you should never be working directly on a production server.

0:52 Always test your code before it goes live. 0:56 To make use of these advantages, we need to set up a local development environment. 1:01 This means installing the programs we need for. 1:04 our local computer to work as a web server. 1:07 Namely, Apache, MySQL, and PHP.

1:10 There are many different ways to set up a local development environment. 1:15 Most involve at least some use of the command line and. 1:18 can be pretty scary if you don't know what you're doing. 1:22 I'll be showing you a quick and simple method,. 1:25 which will allow even complete beginners to get up and running within minutes. 1:29 Make sure you check out the notes, for more resources and advanced options. 1:34 Let's get started!.

1:36 In our web browser, let's search for MAMP. 1:40 The first one is MAMP & MAMP Pro at mamp.info. 1:44 Click on Downloads and then Download again. 1:48 This may take a little while to download depending on your Internet connection. 1:52 Once the file is downloaded, open the installer and. 1:54 it will guide you through these necessary steps to install the software. 1:58 Make sure you allow it to make changes to the computer.

2:01 Choose your language of choice. 2:07 And if you'd like to install MAMP Pro at this time, leave the box checked. 2:11 If you want more information about MAMP Pro, check out the notes. 2:16 Make sure you read and agree to the terms. 2:26 And let the software install. 2:28 MAMP & MAMP Pro have been installed successfully you may close the installer.

2:33 Go to your C drive, where you will see the MAMP the MAMP Pro folders. 2:38 You can also launch MAMP from the shortcut if you created one. 2:42 And MAMP we'll go into MAMP and this is where the magic happens. 2:47 It starts our server and turns our computer into a web server.

2:52 We open the start page and we'll see information about our server. 2:55 We'll see our MySQL install which is our database.

2:59 You have your tools, either phpMyAdmin or phpLiteAdmin, for. 3:03 administering the database. 3:05 Also, phpInfo for all the information about our PHP install.

3:10 For now, take off everything after localhost and. 3:13 this is where our website is. 3:15 Right now, it just says Index of/, because there's nothing there, so.

3:19 let's fix that first. 3:20 Open you text editor. 3:23 And let's type Test. 3:25 We're going to save this into C://MAMP/htdocs.

3:33 This is where MAMPS stores our files for our website by default. 3:36 Type index.php and hit save. 3:41 Now when we go back to the browser and refresh our page, we'll see Test. 3:45 If I go back into MAMP and stop the server, and then go back into my web. 3:50 browser and click refresh, we're gonna get an error because our server's not running. 3:56 So before you test your website, make sure that you start your servers in MAMP. 4:01 Now, when we refresh, we see our website again.

4:05 Congratulations. 4:06 Technically, that's all we need to do.

4:08 However, I want to show you one configuration step. 4:10 that will make our workflow a little easier. 4:13 Most people find it better to work in the Documents folder,. 4:16 usually within a sites folder, and then separate folders for each project. 4:20 So let's set that up.

4:22 We'll go into our text editor, and here we're gonna just add Documents, so. 4:27 that we know that it's looking into a new location. 4:29 So we go File Save As, and we're gonna go into our Documents. 4:35 Create a folder called sites. 4:38 And then a new folder called testsites. 4:42 We'll leave it as index.php and click Save. 4:46 Now we go back into MAMP and under Preferences,.

4:50 you'll see the Web Server tab. 4:52 You see that the document root shows CMAMP htdocs. 4:57 This is what we want to change, so click Select. 5:00 Go into Documents sites testsite, and click OK. 5:06 Now we click OK again, and MAMP will restart our servers.

5:10 Now when we go back to the web browser and. 5:13 click refresh, we'll see that it says Test Documents, and.

5:16 we know that it's now looking in the new location for our website. 5:21 If I wanted to have multiple projects, I could set that up with MAMP,. 5:25 without using MAMP Pro, by just changing our root document. 5:28 This will allow me to have multiple websites, but only one running at a time. 5:33 Let's give this a try.

5:35 Go back into your text editor and. 5:39 we're going to say Test Website 2. 5:43 And then we're going to save this as testsite2.

5:52 Leave it as index and Save. 5:55 Now we go back into MAMP. 5:58 Back to our preferences, our web server and we're going to change this location. 6:04 So instead of being in this testsite folder we're now going into testsite2. 6:10 We'll click OK, and OK again. 6:13 Again, our servers will restart, and then we can go back into the browser.

Setup Development Environment Windo…

6:19 Now when we hit refresh, you'll see that it says Test Website 2. 6:24 So now we have two different websites that we can go back and. 6:27 forth between using just MAMP.

6:30 Remember, if you wanna test out your other site, you need to go back into MAMP,. 6:33 Preferences Web Server, and once again, change the document route. 6:40 Now that you have your local dev environment set up,. 6:43 you're ready to code anywhere. 6:45 A laptop might come in handy too.

Windows Development Environment Setup

Setup local dev environment

Mac Development Environment

6:48 Remember to check out the notes, where you'll find a lot more resources and. 6:52 advanced options. 6:53 Until next time, maybe I'll see you at the beach.