<?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>Forem: David Long</title>
    <description>The latest articles on Forem by David Long (@davdaarn).</description>
    <link>https://forem.com/davdaarn</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%2F175399%2F07f73c7a-edae-474c-b7f7-2ee8aabf521a.png</url>
      <title>Forem: David Long</title>
      <link>https://forem.com/davdaarn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/davdaarn"/>
    <language>en</language>
    <item>
      <title>First time ever installing PHP and Laravel on Windows</title>
      <dc:creator>David Long</dc:creator>
      <pubDate>Tue, 04 Jun 2019 01:06:10 +0000</pubDate>
      <link>https://forem.com/davdaarn/first-time-ever-installing-php-and-laravel-on-windows-jun-2019-3i4</link>
      <guid>https://forem.com/davdaarn/first-time-ever-installing-php-and-laravel-on-windows-jun-2019-3i4</guid>
      <description>&lt;p&gt;Today I decided to take a crack at setting up a Laravel environment on my personal machine. I did a tiny bit of Laravel coding at my previous job, but I wanted to build something from scratch that I could use for a portfolio project. I found a good tutorial on YouTube, but two hours after starting I was still only 8 minutes into the video. I missed a critical step, and I kept running into issues. In the end everything was super easy to fix, but I'm documenting the setup process for future reference, and hopefully this will save someone else some grief as well.&lt;/p&gt;

&lt;p&gt;As a disclaimer, I'm on Windows and using the latest software releases as of Jun 2019. Mileage may vary.&lt;/p&gt;

&lt;p&gt;First thing to do is &lt;a href="https://www.php.net/"&gt;download&lt;/a&gt; and setup PHP. I downloaded version 7.1.30.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4G8Ie81Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/php_download.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4G8Ie81Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/php_download.png" alt="windows download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next create a folder where you want PHP to live. I created mine at the root of C the drive. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CTkCfRTq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/php_folder.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CTkCfRTq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/php_folder.png" alt="windows download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the PHP file has downloaded, extract the contents of the zip file to your new folder. And add the folder location to your &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F1rFcgZ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/env.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F1rFcgZ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/env.PNG" alt="windows download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next copy/rename the &lt;code&gt;php.ini-development&lt;/code&gt; file to be called &lt;code&gt;php.ini&lt;/code&gt;. It's very important that this file exists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zjzQv2pP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/php_directory.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zjzQv2pP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/php_directory.png" alt="windows download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the newly created file configure the extensions by searching for and un-commenting these lines of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;extension_dir = "ext"
extension=openssl
extension=mbstring
extension=fileinfo

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dAqXy4qy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/extension_dir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dAqXy4qy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/extension_dir.png" alt="windows download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ufRu9xQb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/extensions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ufRu9xQb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/extensions.png" alt="windows download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first two lines of code above solve the following error when trying to install Laravel via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Composer\Exception\NoSslException]                 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And by modifying the &lt;code&gt;ini&lt;/code&gt; file to include the necessary extensions this &lt;em&gt;should&lt;/em&gt; prevent composer from trying to modify the file during install.&lt;/p&gt;

&lt;p&gt;Next install &lt;a href="https://getcomposer.org/download/"&gt;Composer&lt;/a&gt;. For me downloading the &lt;code&gt;exe&lt;/code&gt; and installing with accepting the defaults was sufficient. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oJozajcu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/composer_installer.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oJozajcu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/davdaarn/assets/master/assets/blog_post1/composer_installer.png" alt="composer download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After Composer is installed run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer global require laravel/installer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then you should be able to run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;laravel new myFirstProject
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And hopefully you will be free from errors. If you do encounter any errors it's likely an issue with the &lt;code&gt;ini&lt;/code&gt; file and missing extensions.&lt;/p&gt;

&lt;p&gt;I know that this installation process is very trivial and hardly in need of a guide ( and there are probably better ways to get setup). But being new to the world of PHP the setup process was a bit foreign to me and I managed to get hung up for bit. Hope this helps someone.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
