<?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: Horváth Gergely</title>
    <description>The latest articles on DEV Community by Horváth Gergely (@hunwalk).</description>
    <link>https://dev.to/hunwalk</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%2F448023%2Fb47954bb-afae-4f8f-9a5f-fd9a9b9486fc.png</url>
      <title>DEV Community: Horváth Gergely</title>
      <link>https://dev.to/hunwalk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hunwalk"/>
    <language>en</language>
    <item>
      <title>Forget XAMPP! Create a dev environment | Part 2 | Install composer</title>
      <dc:creator>Horváth Gergely</dc:creator>
      <pubDate>Fri, 07 Aug 2020 17:46:52 +0000</pubDate>
      <link>https://dev.to/hunwalk/forget-xampp-and-other-desktop-server-bundles-create-a-dev-environment-part-2-install-composer-3obj</link>
      <guid>https://dev.to/hunwalk/forget-xampp-and-other-desktop-server-bundles-create-a-dev-environment-part-2-install-composer-3obj</guid>
      <description>&lt;p&gt;In the first part, we installed our PHP runtime library.&lt;br&gt;
Now that we can access it from terminal, we can move forward to install the most useful tool that is ever existed for PHP, and that is &lt;strong&gt;Composer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tjwQCRM6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://getcomposer.org/img/logo-composer-transparent.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tjwQCRM6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://getcomposer.org/img/logo-composer-transparent.png" width="290" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Composer is the package manager for PHP. It's fairly complex, so it's would be wise to read the docs... ooor you could just use this cheatsheet for now: &lt;a href="https://devhints.io/composer"&gt;https://devhints.io/composer&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;
  
  
  Prerequisities
&lt;/h1&gt;
&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;p&gt;You have to enable some of the PHP extensions in order to download composer with the &lt;code&gt;copy&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;On linux that is fairly easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;php7.3-curl php7.3-openssl php7.3-mbstring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mac OS
&lt;/h3&gt;

&lt;p&gt;You don't really need to do anything, if i recall correctly everything went smoothly without enabling anything at all.&lt;br&gt;
But if something comes up, try to follow along the windows version.&lt;/p&gt;
&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;Now this is will be a little bit longer. If you've been following around this "tutorial" series then you will be able to find the &lt;code&gt;php.ini&lt;/code&gt; configuration file.&lt;/p&gt;

&lt;p&gt;If however you have your own runtime library, and you don't know where is it, the fastest way to figure it out is to enter this command in cmd ( or powershell )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php --ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're lucky, you will find a line saying &lt;code&gt;Loaded Configuration File&lt;/code&gt; containing the route to your php.ini&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you've got an error, that means that either php is not installed properly, or the path to it is not set amongst the envornmental variables on windows. If that is the case you should move back to my first tutorial in this series and try again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In that file you have remove the &lt;code&gt;;&lt;/code&gt; semicolon character at the beggining of these lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;;extension=curl
;extension=openssl
;extension=mbstring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Install
&lt;/h1&gt;

&lt;p&gt;If you've done everything correctly now you should be able to install composer. Follow this link: &lt;a href="https://getcomposer.org/download/"&gt;https://getcomposer.org/download/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And copy&amp;amp;paste the 4 commands from the bordered box.&lt;/p&gt;

&lt;p&gt;For global installation follow this guide: &lt;a href="https://getcomposer.org/doc/00-intro.md#globally"&gt;https://getcomposer.org/doc/00-intro.md#globally&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Mac and Linux versions are fairly easy, you just have to use this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mv &lt;/span&gt;composer.phar /usr/local/bin/composer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, Windows is a little bit different. But we have a huge advantage if we installed php with chocolatey. Because the runtime folder is added to the PATH. So modifying the official composer guide, we will get to something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\tools\php&amp;gt; echo @php "%~dp0composer.phar" %*&amp;gt;composer.bat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you did everything right, by entering the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Composer version 1.10.6 2020-05-06 10:28:10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GG boi, now you have composer installed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3o7abKhOpu0NwenH3O/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o7abKhOpu0NwenH3O/source.gif" alt="#goodjob" width="540" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sidenote: There are some rare cases when a project is heavily relying on a specific composer version, thus it should have it's unique php archive. I'm not saying it's bad, but it's a good practice to have composer installed globally anyways.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>php</category>
      <category>composer</category>
      <category>apache2</category>
      <category>environment</category>
    </item>
    <item>
      <title>Forget XAMPP! Create a dev environment | Part 1 | Install PHP</title>
      <dc:creator>Horváth Gergely</dc:creator>
      <pubDate>Fri, 07 Aug 2020 09:18:09 +0000</pubDate>
      <link>https://dev.to/hunwalk/forget-xampp-and-other-desktop-server-bundles-create-a-dev-environment-part-1-2boj</link>
      <guid>https://dev.to/hunwalk/forget-xampp-and-other-desktop-server-bundles-create-a-dev-environment-part-1-2boj</guid>
      <description>&lt;p&gt;It's easy right? Just pushing your stuff into a directory somewhere on your pc then accessing it from a url? &lt;/p&gt;

&lt;p&gt;Well yeah, then you want to deploy your project into production and it breaks because of the url rules you had to set up in order to be able to work on it.&lt;/p&gt;

&lt;p&gt;In this article i will show you how i do it after 2 years ( and i still have much to learn )&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisities
&lt;/h1&gt;

&lt;p&gt;You need some kind of package manager first. If you're on &lt;code&gt;linux&lt;/code&gt; you're safe. Just&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;php7.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;But most of you reading this article for better practices aren't using linux. If you were, you wouldn't need this I'm sure. So, here you go then, package manager for Windows.&lt;/p&gt;
&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Wait what? Is there a package manager for Windows?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well duh, ofc you dumbass. If you did not heard about it, you may've been sleeping under a rock or i dunno.&lt;/p&gt;

&lt;p&gt;You can find everything here: &lt;a href="https://chocolatey.org/install"&gt;https://chocolatey.org/install&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then it's just a matter of&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;choco install php --version 7.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command. You will find the php runtime library after the installation at "X:\tools\php". Since choco will adjust your environmental variables, you don't need to do anything after this, just reopen your terminal and enter:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please note that you may have to restart your terminal to make the changes take effect ( if you are using cmd or powershell )&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you've done everything right, you should see the php version and the build number and some other weird stuff you may don't really understand yet. 😄&lt;/p&gt;
&lt;h3&gt;
  
  
  Mac OS
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Homebrew. Did you heard about it? You will need it.&lt;br&gt;
It's quite essential for a Mac if you're a developer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here, follow this link and install: &lt;a href="https://brew.sh/"&gt;https://brew.sh/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If everything went smooth you should be able to install the php runtime library by entering this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;php@7.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can find Part 2 here: &lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/hunwalk" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PJWZH9Vk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--3voYlaRs--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/448023/b47954bb-afae-4f8f-9a5f-fd9a9b9486fc.png" alt="hunwalk"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/hunwalk/forget-xampp-and-other-desktop-server-bundles-create-a-dev-environment-part-2-install-composer-3obj" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Forget XAMPP! Create a dev environment | Part 2 | Install composer&lt;/h2&gt;
      &lt;h3&gt;Horváth Gergely ・ Aug 7 '20 ・ 2 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#php&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#composer&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#apache2&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#environment&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>apache2</category>
      <category>php</category>
      <category>xampp</category>
      <category>environment</category>
    </item>
  </channel>
</rss>
