<?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: Prakash Nayak</title>
    <description>The latest articles on DEV Community by Prakash Nayak (@prakash_nayak).</description>
    <link>https://dev.to/prakash_nayak</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%2F1478482%2F95e60da6-b5b2-4d05-a9d3-d1c9e3b1cac1.jpeg</url>
      <title>DEV Community: Prakash Nayak</title>
      <link>https://dev.to/prakash_nayak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prakash_nayak"/>
    <language>en</language>
    <item>
      <title>Deploy Laravel 11 Project to Hostinger Business Web Hosting Plan</title>
      <dc:creator>Prakash Nayak</dc:creator>
      <pubDate>Wed, 08 May 2024 18:36:20 +0000</pubDate>
      <link>https://dev.to/prakash_nayak/deploy-laravel-11-project-to-hostinger-business-web-hosting-plan-ea3</link>
      <guid>https://dev.to/prakash_nayak/deploy-laravel-11-project-to-hostinger-business-web-hosting-plan-ea3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Create Subdomain or Main Domain Directory&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Navigate to either the subdomain directory (e.g., &lt;code&gt;public_html/subdomain/&lt;/code&gt;) or the main domain directory (e.g., &lt;code&gt;public_html/&lt;/code&gt;) on your server.&lt;/p&gt;

&lt;p&gt;Then go to Hostinger Dashboard Advanced Menu -&amp;gt; SSH Access -&amp;gt; Activate the status.&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%2Fk8thvxfqmq2ne0hjmffe.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%2Fk8thvxfqmq2ne0hjmffe.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get SSH access from the Hostinger dashboard.&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%2Fns5xae3auaxf6ug7yrao.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%2Fns5xae3auaxf6ug7yrao.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you log in to the SSH key, copy it, go to the &lt;strong&gt;Terminal&lt;/strong&gt;, paste the key, and use the &lt;strong&gt;generated password from the SSH details card table&lt;/strong&gt; Enter in your &lt;strong&gt;Bash terminal(Windows).&lt;/strong&gt;&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%2F9ljdb56xvb4wt5rp6sjv.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%2F9ljdb56xvb4wt5rp6sjv.png" alt="Image description"&gt;&lt;/a&gt;&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%2F2t552isepcrer2wunhbm.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%2F2t552isepcrer2wunhbm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to your desired domain directory root using command &lt;code&gt;cd directory/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To go back from directory use command &lt;code&gt;cd ..&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clone Project with Git&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Use SSH to navigate to the project's root folder within the chosen directory.

* Clone your project from Git to the root project folder:

* Once you get access to your SSH Terminal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F1pv60p614l47qhf1vluj.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%2F1pv60p614l47qhf1vluj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Bash Terminal to your root directory of domain/sub domain&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone your-project-repository-url .&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Composer Locally&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Install Composer locally with the following commands in SSH Terminal of your domain directory:

    ```bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified. Things look pretty good. Just as Xima. After finishing - call this script again to install vendors...&amp;lt;/br&amp;gt;&amp;lt;/br&amp;gt;'; require_once 'composer-setup.php'; }"
    php composer.phar -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
4. **Install Composer Dependencies**:

    * Inside the project folder, install Composer dependencies in SSH Terminal of your domain directory:

        ```bash


        php composer.phar install


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build Assets with Vite&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Build your assets using Vite in your local project XAMPP/Laragon etc.

* Upload the generated `build` folder to the server at the respective location.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run Database Migrations&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Run database migrations to create necessary tables in SSH Terminal of your domain directory:

    ```bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
7. **Create Symbolic Link for Storage** in SSH Terminal of your domain directory:

    * Create a symbolic link from the `public/storage` directory to the `storage/app/public` directory:

        ```bash


        php artisan storage:link


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update .htaccess use hostinger file explorer and goto your root directory of your domain create .htaccess if its not available then enter the code&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Update the `.htaccess` file in the root of your domain project with the following rules:

    ```apache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    # BEGIN WordPress
    &amp;lt;IfModule mod_rewrite.c&amp;gt;
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
    &amp;lt;/IfModule&amp;gt;
    # END WordPress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
9. **Update .env file**:

    * **Use Hostinger File Explorer and go to your domain's root directory** Update the `.env` file in the root of your Laravel project with your environment-specific configurations.

        ```plaintext


        APP_URL=https://domainurl.com
        .....
        DB_CONNECTION=mysql
        DB_HOST=127.0.0.1
        DB_PORT=3306
        DB_DATABASE=databasenamecreated
        DB_USERNAME=databaseusernamecreated
        DB_PASSWORD=addpasswordcreated
        .....
        ASSET_URL=https://domain.com/public


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

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Done Completed&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
  </channel>
</rss>
