検索
ホームページバックエンド開発PHPチュートリアルAndroid でデータベースを使用した PHP および Laravel 環境を作成するにはどうすればよいですか?

Prerequisites:

  • An Android Phone with v7.0 or higher

First you need to install termux from Play Store. Here is the app URL : Termux App

Setup Process Of Laravel:

Termux update and upgrade

Run the below command to update and upgrade termux.

apt-get update    # Updates the list of available packages
apt-get upgrade   # Upgrades all installed packages to their latest 

Install PHP and Composer

To install PHP and composer run the following commands.

pkg update
pkg upgrade
pkg install php
pkg install composer

Create your first Laravel project

To create a laravel project run the following command.

composer create laravel/laravel my_first_app

It would help if you had a good internet connection to install the Laravel app.

Run the server

cd my_first_app
php artisan serve

Now to go browser and type http://127.0.0.1:8000

The Laravel server is started at 127.0.0.1:8000

How do you create PHP and Laravel environments with databases in Android?

Setup MySQL and PHPMyAdmin:

Install MariaDB with MySQL

Run the following command to install.

pkg install mariadb #install mariadb
mysqld_safe -u root #start the SQL server

Then press ctrl + z and type the following command.

mariadb

Then the following MariaDB interface will show. You can run commands here to create edit delete and update databases and tables.

How do you create PHP and Laravel environments with databases in Android?

Setup PHPMyAdmin

To setup PHPMyAdmin run the following commands.

cd ~/
composer create-project phpmyadmin/phpmyadmin

Now we will rename a file name config.sample.inc.php ** to **config.inc.php To do this run the below command in the phpmyadmin directory.

cd phpmyadmin
mv config.sample.inc.php config.inc.php

Now we will edit the config file to allow login without a password.

pkg install vim
vim config.inc.php

Change the AllowNoPassword value from false to true and also change the host from localhost to 127.0.0.1

How do you create PHP and Laravel environments with databases in Android?

Go to the line that is showing in the image and then do the following instructions:

i #press i for insert mode

After pressing i change the value from false to true. After that press esc and run the following commands:

:w
:q
php -S localhost:4000

In the another tab of the termux run the command.

mysqld_safe -u root

Now go to http://localhost:4000 and now provide the credintials.
**
username: root
Password:
**
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)

A short video of the final output and .env file edit

Thanks for reading the article.

以上がAndroid でデータベースを使用した PHP および Laravel 環境を作成するにはどうすればよいですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
11ベストPHP URLショートナースクリプト(無料およびプレミアム)11ベストPHP URLショートナースクリプト(無料およびプレミアム)Mar 03, 2025 am 10:49 AM

多くの場合、キーワードと追跡パラメーターで散らかった長いURLは、訪問者を阻止できます。 URL短縮スクリプトはソリューションを提供し、ソーシャルメディアやその他のプラットフォームに最適な簡潔なリンクを作成します。 これらのスクリプトは、個々のWebサイトにとって価値があります

Instagram APIの紹介Instagram APIの紹介Mar 02, 2025 am 09:32 AM

2012年のFacebookによる有名な買収に続いて、Instagramはサードパーティの使用のために2セットのAPIを採用しました。これらはInstagramグラフAPIとInstagram Basic Display APIです。

Laravelでフラッシュセッションデータを使用しますLaravelでフラッシュセッションデータを使用しますMar 12, 2025 pm 05:08 PM

Laravelは、直感的なフラッシュメソッドを使用して、一時的なセッションデータの処理を簡素化します。これは、アプリケーション内に簡単なメッセージ、アラート、または通知を表示するのに最適です。 データは、デフォルトで次の要求のためにのみ持続します。 $リクエスト -

LaravelのバックエンドでReactアプリを構築する:パート2、ReactLaravelのバックエンドでReactアプリを構築する:パート2、ReactMar 04, 2025 am 09:33 AM

これは、LaravelバックエンドとのReactアプリケーションの構築に関するシリーズの2番目と最終部分です。シリーズの最初の部分では、基本的な製品上場アプリケーションのためにLaravelを使用してRESTFUL APIを作成しました。このチュートリアルでは、開発者になります

Laravelテストでの簡略化されたHTTP応答のモッキングLaravelテストでの簡略化されたHTTP応答のモッキングMar 12, 2025 pm 05:09 PM

Laravelは簡潔なHTTP応答シミュレーション構文を提供し、HTTP相互作用テストを簡素化します。このアプローチは、テストシミュレーションをより直感的にしながら、コード冗長性を大幅に削減します。 基本的な実装は、さまざまな応答タイプのショートカットを提供します。 Illuminate \ support \ facades \ httpを使用します。 http :: fake([[ 'google.com' => 'hello world'、 'github.com' => ['foo' => 'bar']、 'forge.laravel.com' =>

PHPのカール:REST APIでPHPカール拡張機能を使用する方法PHPのカール:REST APIでPHPカール拡張機能を使用する方法Mar 14, 2025 am 11:42 AM

PHPクライアントURL(CURL)拡張機能は、開発者にとって強力なツールであり、リモートサーバーやREST APIとのシームレスな対話を可能にします。尊敬されるマルチプロトコルファイル転送ライブラリであるLibcurlを活用することにより、PHP Curlは効率的なexecuを促進します

Codecanyonで12の最高のPHPチャットスクリプトCodecanyonで12の最高のPHPチャットスクリプトMar 13, 2025 pm 12:08 PM

顧客の最も差し迫った問題にリアルタイムでインスタントソリューションを提供したいですか? ライブチャットを使用すると、顧客とのリアルタイムな会話を行い、すぐに問題を解決できます。それはあなたがあなたのカスタムにより速いサービスを提供することを可能にします

2025 PHP状況調査の発表2025 PHP状況調査の発表Mar 03, 2025 pm 04:20 PM

2025 PHP Landscape Surveyは、現在のPHP開発動向を調査しています。 開発者や企業に洞察を提供することを目的とした、フレームワークの使用、展開方法、および課題を調査します。 この調査では、現代のPHP Versioの成長が予想されています

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

SublimeText3 Linux 新バージョン

SublimeText3 Linux 新バージョン

SublimeText3 Linux 最新バージョン

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール