<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Heather</title>
    <description>The latest articles on DEV Community by Heather (@nearlythere).</description>
    <link>https://dev.to/nearlythere</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F56581%2F322dd71d-d432-47c3-bc95-ce442a1bf6e6.jpg</url>
      <title>DEV Community: Heather</title>
      <link>https://dev.to/nearlythere</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nearlythere"/>
    <language>en</language>
    <item>
      <title>What do you need for a PHP local development environment?</title>
      <dc:creator>Heather</dc:creator>
      <pubDate>Thu, 21 Jun 2018 15:51:57 +0000</pubDate>
      <link>https://dev.to/nearlythere/what-do-you-need-for-a-php-local-development-environment-1hk4</link>
      <guid>https://dev.to/nearlythere/what-do-you-need-for-a-php-local-development-environment-1hk4</guid>
      <description>&lt;p&gt;Using a local dev environment is standard practice, and yet, getting a stack that is easy to set up and use is still a challenge. If you’re using a Mac, many tutorials recommend building the development environment &lt;a href="https://mallinson.ca/osx-web-development/"&gt;natively&lt;/a&gt;, since Apache is bundled with macOS. &lt;/p&gt;

&lt;p&gt;Adding a few elements seems easy, after all, a local development environment for PHP includes at minimum two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  A web server configured to compile and run your PHP scripts on the fly and serve them to your browser.&lt;/li&gt;
&lt;li&gt;  A database server to pull data and render it in your PHP application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, that isn’t enough in most cases. You may also want to make it easier to manage and test your application, so you would also need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  SSH access.&lt;/li&gt;
&lt;li&gt;  An email catch-all.&lt;/li&gt;
&lt;li&gt;  And what about local SSL support?&lt;/li&gt;
&lt;li&gt;  Virtual hosts to easily access your works-in-progress in your browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To set these up, even for one site, you’re looking at some detailed configuration. If you were just managing ONE site, it wouldn’t be a problem. However, to make it easier to add and manage multiple sites, you might also want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  A way to start and stop services.&lt;/li&gt;
&lt;li&gt;  Some way to manage those databases, like PHPMyAdmin.&lt;/li&gt;
&lt;li&gt;  Configuring specific versions of your PHP projects&lt;/li&gt;
&lt;li&gt;  A way to manage custom environment variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And once you starting adding all of those packages to manage these, you need some way to manage them and keep them up to date. Oh... and what if you want to add new projects without repeating the same setup each time? This is why Docker containers have gotten more popular in the last few years. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.drud.com/ddev-local/docker-containers-vs-vms-for-quick-consistent-local-dev/"&gt;Docker shows up well comparison to other options like VMs&lt;/a&gt; when it comes to lightweight local development. Docker containers are faster and they don’t consume a lot of resources. With Docker Compose, you can manage different packages and dependencies. For example, you can set up different PHP environments per project, or add services like Apache Solr. &lt;/p&gt;

&lt;p&gt;The main issue with Docker? That is a lot to manage and maintain and takes considerable knowledge of Docker to set up. So! There have been many local development tools released which package up the tools you need, and make it work. One of these options is &lt;a href="https://github.com/drud/ddev"&gt;DDEV-Local, which is completely free and open source&lt;/a&gt;. It comes with everything you need to create local development and quickly deploy to production.&lt;/p&gt;

&lt;p&gt;Here's a video tutorial showing you &lt;a href="https://www.drud.com/ddev-local/ddev-local-scratch-macos/"&gt;how to set up DDEV-Local from scratch on macOS&lt;/a&gt;. This gives you a complete PHP development environment with developer tools like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MySQL Client (mysql) – Command-line interface for interacting with MySQL.&lt;/li&gt;
&lt;li&gt;Composer – Dependency Manager for PHP.&lt;/li&gt;
&lt;li&gt;Drush – Command-line shell and Unix scripting interface for Drupal.&lt;/li&gt;
&lt;li&gt;WP-CLI – Command-line tools for managing WordPress installations.&lt;/li&gt;
&lt;li&gt;MailHog mail catcher for email capture and review.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read more about the &lt;a href="https://ddev.readthedocs.io/en/latest/users/developer-tools/"&gt;developer tools in the docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Need any help? Post your questions tagged with &lt;a href="https://stackoverflow.com/questions/tagged/ddev"&gt;#ddev on Stack Overflow&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>php</category>
      <category>docker</category>
      <category>drupal</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
