<?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: AJDM Jakiur Rahmam</title>
    <description>The latest articles on Forem by AJDM Jakiur Rahmam (@jakiur).</description>
    <link>https://forem.com/jakiur</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%2F1555979%2Fa938a628-758b-4434-885a-6a4e032bd0ca.jpg</url>
      <title>Forem: AJDM Jakiur Rahmam</title>
      <link>https://forem.com/jakiur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jakiur"/>
    <language>en</language>
    <item>
      <title>How do you create PHP and Laravel environments with databases in Android?</title>
      <dc:creator>AJDM Jakiur Rahmam</dc:creator>
      <pubDate>Wed, 02 Oct 2024 14:58:45 +0000</pubDate>
      <link>https://forem.com/jakiur/how-do-you-create-php-and-laravel-environments-with-databases-in-android-534f</link>
      <guid>https://forem.com/jakiur/how-do-you-create-php-and-laravel-environments-with-databases-in-android-534f</guid>
      <description>&lt;p&gt;Prerequisites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Android Phone with v7.0 or higher&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First you need to install termux from Play Store. Here is the app URL : &lt;a href="https://play.google.com/store/apps/details?id=com.termux&amp;amp;hl=en&amp;amp;pli=1" rel="noopener noreferrer"&gt;Termux App&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Process Of Laravel:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Termux update and upgrade
&lt;/h3&gt;

&lt;p&gt;Run the below command to update and upgrade termux.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get update    &lt;span class="c"&gt;# Updates the list of available packages&lt;/span&gt;
apt-get upgrade   &lt;span class="c"&gt;# Upgrades all installed packages to their latest &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install PHP and Composer
&lt;/h3&gt;

&lt;p&gt;To install PHP and composer run the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkg update
pkg upgrade
pkg &lt;span class="nb"&gt;install &lt;/span&gt;php
pkg &lt;span class="nb"&gt;install &lt;/span&gt;composer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create your first Laravel project
&lt;/h3&gt;

&lt;p&gt;To create a laravel project run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer create laravel/laravel my_first_app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It would help if you had a good internet connection to install the Laravel app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;my_first_app
php artisan serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to go browser and type &lt;a href="http://127.0.0.1:8000" rel="noopener noreferrer"&gt;http://127.0.0.1:8000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Laravel server is started at 127.0.0.1:8000&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%2F9lgwglcyjr34pz1nqc98.jpg" 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%2F9lgwglcyjr34pz1nqc98.jpg" alt="This is the welcome page of laravel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup MySQL and PHPMyAdmin:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install MariaDB with MySQL
&lt;/h3&gt;

&lt;p&gt;Run the following command to install.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;mariadb &lt;span class="c"&gt;#install mariadb&lt;/span&gt;
mysqld_safe &lt;span class="nt"&gt;-u&lt;/span&gt; root &lt;span class="c"&gt;#start the SQL server&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then press &lt;strong&gt;ctrl + z&lt;/strong&gt; and type the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the following MariaDB interface will show. You can run commands here to create edit delete and update databases and tables.&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%2F1dfnillfbn10gaypvyh0.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%2F1dfnillfbn10gaypvyh0.png" alt="MariaBD Interface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup PHPMyAdmin
&lt;/h3&gt;

&lt;p&gt;To setup PHPMyAdmin run the following commands.&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="nb"&gt;cd&lt;/span&gt; ~/
composer create-project phpmyadmin/phpmyadmin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we will rename a file name &lt;strong&gt;config.sample.inc.php ** to **config.inc.php&lt;/strong&gt; To do this run the below command in the phpmyadmin  directory.&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="nb"&gt;cd &lt;/span&gt;phpmyadmin
&lt;span class="nb"&gt;mv &lt;/span&gt;config.sample.inc.php config.inc.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we will edit the config file to allow login without a password.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;vim
vim config.inc.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the &lt;strong&gt;AllowNoPassword&lt;/strong&gt; value from &lt;strong&gt;false&lt;/strong&gt; to &lt;strong&gt;true&lt;/strong&gt; and also change the &lt;strong&gt;host&lt;/strong&gt; from &lt;strong&gt;localhost&lt;/strong&gt; to &lt;strong&gt;127.0.0.1&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%2F8mb08c22xjvcvqmectz4.jpeg" 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%2F8mb08c22xjvcvqmectz4.jpeg" alt="Config file in vim editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to the line that is showing in the image and then do the following instructions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;i &lt;span class="c"&gt;#press i for insert mode&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After pressing i change the value from &lt;strong&gt;false&lt;/strong&gt; to &lt;strong&gt;true.&lt;/strong&gt; After that press esc and run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;:w
:q
php &lt;span class="nt"&gt;-S&lt;/span&gt; localhost:4000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the another tab of the termux run the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysqld_safe &lt;span class="nt"&gt;-u&lt;/span&gt; root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now go to &lt;strong&gt;&lt;a href="http://localhost:4000" rel="noopener noreferrer"&gt;http://localhost:4000&lt;/a&gt;&lt;/strong&gt; and now provide the credintials.&lt;br&gt;
**&lt;br&gt;
username: root&lt;br&gt;
Password: &lt;br&gt;
**&lt;br&gt;
&lt;strong&gt;Done! you have successfully setup phpmyadmin with laravel. Now just edit .env file run the command php artisan migrate (of course in a new tab)&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  A short video of the final output and .env file edit
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/1015291050" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Thanks for reading the article.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>php</category>
      <category>laravel</category>
      <category>android</category>
    </item>
  </channel>
</rss>
