<?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: gpisano97</title>
    <description>The latest articles on DEV Community by gpisano97 (@gpisano97).</description>
    <link>https://dev.to/gpisano97</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%2F1044877%2F3e26fd0a-46db-4712-af89-bf62cf8b7dd2.png</url>
      <title>DEV Community: gpisano97</title>
      <link>https://dev.to/gpisano97</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gpisano97"/>
    <language>en</language>
    <item>
      <title>PHP Api Rest alternative</title>
      <dc:creator>gpisano97</dc:creator>
      <pubDate>Mon, 26 Jun 2023 15:18:28 +0000</pubDate>
      <link>https://dev.to/gpisano97/php-api-rest-alternative-a5d</link>
      <guid>https://dev.to/gpisano97/php-api-rest-alternative-a5d</guid>
      <description>&lt;p&gt;Hello guys,&lt;/p&gt;

&lt;p&gt;I'm the creator of &lt;a href="https://github.com/gpisano97/Micron"&gt;Micron&lt;/a&gt;,it is an API Rest framework for PHP that permit to create API Rest. It supports MySQL Database, complex routes definitision, JWT Token authentication and authorization. To speed up the development i also created a beautiful Database class that extends PDO with some awesome functionalities...&lt;/p&gt;

&lt;p&gt;Why i'm doing this post? Because is very very difficult to popularize a project, i used it in many works with my company, and i think that can be very helpfull and can improve the productivity!&lt;/p&gt;

&lt;p&gt;I'm still developing new functions and improvement, i support it at 100% (also because I use it in my works) and i think that if it can be used from more people Micron can become ever bigger!&lt;/p&gt;

&lt;p&gt;So, i know, there i a little lack in the documentation and the "tutorial" section is still under construction, but if you want to see something new, simple and fast, check my little baby and let me know what you think about it!&lt;/p&gt;

&lt;p&gt;Good coding to everyone.&lt;/p&gt;

</description>
      <category>php</category>
      <category>api</category>
      <category>rest</category>
    </item>
    <item>
      <title>Apache tutorial - how to setup a virtual host for php's projects separation</title>
      <dc:creator>gpisano97</dc:creator>
      <pubDate>Thu, 16 Mar 2023 14:27:29 +0000</pubDate>
      <link>https://dev.to/gpisano97/apache-tutorial-how-to-setup-a-virtual-host-for-phps-projects-separation-1lp6</link>
      <guid>https://dev.to/gpisano97/apache-tutorial-how-to-setup-a-virtual-host-for-phps-projects-separation-1lp6</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;Usually a developer is engaged in more projects at once, so for standard developer is pretty simple: they compile and run every application (usually from the IDE) like standalone "entity". How can php web developer had this separation between different projects ?&lt;/p&gt;

&lt;p&gt;Forget about imaginative solutions, the right way to achieve this is using Apache's virtual hosts!!!&lt;/p&gt;

&lt;p&gt;A virtual host allows to create a virtual server where the server root is the path given... and much much more!&lt;/p&gt;

&lt;p&gt;In this tutorial i will cover the basic usage of the virtual host and at the end we will access our projects from different entry point. Let's start!&lt;/p&gt;

&lt;h2&gt;
  
  
  Clarification
&lt;/h2&gt;

&lt;p&gt;This is the way i use it in production mode, so i put every host on different port and access it through &lt;strong&gt;&lt;em&gt;localhost&lt;/em&gt;&lt;/strong&gt;. On windows you can modify your &lt;strong&gt;&lt;em&gt;host&lt;/em&gt;&lt;/strong&gt; file and access to the server with the server name.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;An installation of Apache ( I work on Windows so i use XAMPP).&lt;/li&gt;
&lt;li&gt;A text editor&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Listening the ports
&lt;/h3&gt;

&lt;p&gt;The first step is to setup apache for listening on the desidered port, which will be the port that allow us to access the virtual host.&lt;/p&gt;

&lt;p&gt;To achieve this let's edit the &lt;strong&gt;&lt;em&gt;httpd.conf&lt;/em&gt;&lt;/strong&gt; file.&lt;br&gt;
In my case (XAMPP on Windows) i can open it from the XAMPP control panel or i can go in the installation folder of XAMMP and follow this path:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;strong&gt;apache\conf\httpd.conf&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now is pretty simple, under the other &lt;strong&gt;Listen&lt;/strong&gt; we add another (i usually find with search text the &lt;strong&gt;Listen&lt;/strong&gt; word) with our port:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rqv11qk7tz97gz473wj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rqv11qk7tz97gz473wj.png" alt="httpd screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Setting up the virtual host
&lt;/h3&gt;

&lt;p&gt;The last point of this small tutorial! We have to move in another apache folder, and edit the &lt;strong&gt;&lt;em&gt;httpd-vhost.conf&lt;/em&gt;&lt;/strong&gt; file.&lt;/p&gt;

&lt;p&gt;Usually this file is in this path:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;apache\conf\extra\httpd-vhost.conf&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So open this file, suppose you want to use port 7005, and append these lines  : &lt;/p&gt;

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

NameVirtualHost *:7005

&amp;lt;VirtualHost *:7005&amp;gt;
    DocumentRoot "C:/xampp/htdocs/IDEWorkspace/someOtherFolders/Project1RootFolder"
    ServerName project1_server_name
      &amp;lt;Directory "C:/xampp/htdocs/IDEWorkspace/someOtherFolders/Project1RootFolder"&amp;gt;
        DirectoryIndex index.php
        Require all granted
        AllowOverride All
    &amp;lt;/Directory&amp;gt;
     ##SSLEngine on
     ##SSLCertificateFile "crt/localhost/server.crt"
     ##SSLCertificateKeyFile "crt/localhost/server.key"
&amp;lt;/VirtualHost&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;Some of these lines (like &lt;em&gt;DirectoryIndex index.php&lt;/em&gt;) are optional.&lt;br&gt;
I included (in form of comments) the lines for add the SSL certificate, this will enable the HTTPS protocol.&lt;/p&gt;

&lt;p&gt;After this, restart apache!&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Testing!!
&lt;/h3&gt;

&lt;p&gt;Now we have a virtual server called &lt;em&gt;project1_server_name&lt;/em&gt; where his root is &lt;em&gt;C:/xampp/htdocs/IDEWorkspace/someOtherFolders/Project1RootFolder&lt;/em&gt; and listening on the &lt;em&gt;port 7005&lt;/em&gt;. This means that access to &lt;em&gt;localhost:7005&lt;/em&gt; will access to the root of the server.&lt;/p&gt;

&lt;p&gt;We can test this writing a simple php script and make a get request using Postman:&lt;/p&gt;

&lt;p&gt;I simply put an echo inside index.php in the root folder of the project&lt;/p&gt;

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

echo "Virtual hosts working!!";


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

&lt;/div&gt;

&lt;p&gt;and make an HTTP GET from postman to &lt;em&gt;&lt;em&gt;&lt;a href="http://localhost:7005" rel="noopener noreferrer"&gt;http://localhost:7005&lt;/a&gt;&lt;/em&gt;&lt;/em&gt; URL:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8mlo9j6cmuybg64ksvzm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8mlo9j6cmuybg64ksvzm.png" alt="Postman GET Test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Perfect!! All is working, so enjoy with your new virtual hosts!!!&lt;/p&gt;

&lt;p&gt;Hoping this will help you, dont' forget to follow me!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Micron - The journey - Chapter 1, Why?</title>
      <dc:creator>gpisano97</dc:creator>
      <pubDate>Wed, 15 Mar 2023 17:50:05 +0000</pubDate>
      <link>https://dev.to/gpisano97/micron-the-journey-chapter-1-why-4dpm</link>
      <guid>https://dev.to/gpisano97/micron-the-journey-chapter-1-why-4dpm</guid>
      <description>&lt;p&gt;Hello everyone!&lt;/p&gt;

&lt;p&gt;My name is Girolamo Dario, i'm a full-stack web developer, i'm involved in some pretty cool projects in the company where i works.&lt;/p&gt;

&lt;p&gt;I want to write a series of post about my decision of developing a little Rest API framework... hoping this can inspire some of you!!&lt;br&gt;
This first chapter is called "Why?", this is a good question, why i make this? There are several framework like Lumen (inspired from this name i called my framework Micron), Laravel, etc. but none of this was able of (easily) make me buld API Rest. So i thought, can i develope myself a similar solution that allow me build API Rest in the way i think is the easiest ? &lt;/p&gt;

&lt;p&gt;The trend, in software developing, is to use "already done" standard solutions for various reasons like : the single developer isn't too much "important" because is easily replaceble, no time spent in R&amp;amp;D, no needs of high level skills beacause "knowing" the framework is enough... all good things but i think that exasperate this behavior can clip the wings of innovation, some developers had good ideas but no time (or skills) for develope them!!&lt;br&gt;
I'm a little out of the box, instead of learn something like Lumen or Laravel I invested my time creating something mine, unique, like i want! &lt;/p&gt;

&lt;p&gt;I'm not encouraging you to self-develop all, frameworks are a very good thing, i'm encouraging you to be more enterprising!! Micron is a framework, just like Lumen, the difference is that Micron incarnate my own concept of "easy to use", and i think that Micron is really the easiest to use framework for Rest API on php!&lt;/p&gt;

&lt;p&gt;I published it on github with MIT License, so anyone can use it or develope some functions, i make this choice because i think that use Micron is very very very simple and can allow beginner developer to approach the world of Rest API.&lt;/p&gt;

&lt;p&gt;And this is why Micron is born, now it is widely used in my company for several projects. I still develope "my baby" adding cool unique functions.&lt;/p&gt;

&lt;p&gt;Thank you for reading.... see you soon to my next post!&lt;/p&gt;

</description>
      <category>php</category>
      <category>rest</category>
      <category>api</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
