https://github.com/maytermux/lamptermux
LAMP on Android
https://github.com/maytermux/lamptermux
android apache lamp linux mariadb mysql php phpmyadmin termux
Last synced: about 2 months ago
JSON representation
LAMP on Android
- Host: GitHub
- URL: https://github.com/maytermux/lamptermux
- Owner: mayTermux
- License: gpl-3.0
- Created: 2021-03-04T15:10:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T11:46:18.000Z (over 2 years ago)
- Last Synced: 2024-07-30T19:24:18.507Z (11 months ago)
- Topics: android, apache, lamp, linux, mariadb, mysql, php, phpmyadmin, termux
- Language: Shell
- Homepage:
- Size: 1.72 MB
- Stars: 116
- Watchers: 2
- Forks: 41
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation
- Download or clone the latest release.
```bash
git clone https://github.com/mayTermux/lampTermux
```- Move to directory
```bash
cd lampTermux
```- Run installer script
```bash
./install.sh
```### Information
- **URL Apache** `http://localhost:8080`
- **Default Port Apache** `8080`
- **Default MariaDB User** `mysql -u $(whoami)`
- **htdocs PATH** `$HOME/htdocs`### Overview
| PHP Info | phpmyadmin Login | phpmyadmin |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|  |  |  |
### User Configuration
Apache- htdocs
| Custom PATH 'htdocs' |
| --------------------------------------------------------------------------------------------------------------- |
|  |Default PATH htdocs on
```bash
246 ...
247 ...
248 ...
249 DocumentRoot "/data/data/com.termux/files/home/htdocs"
250
251 ...
252 ...
253 ...
```- Custom extension file that will be at loaded first
| Custom extension file |
| --------------------------------------------------------------------------------------------------------------- |
|  |Default extension file is
```bash
279 ...
280 ...
281 ...
282
283 DirectoryIndex index.php
284
285 ...
286 ...
287 ...
```If you want custom htdocs or extension file that will be at loaded first, change the configuration on file `/data/data/com.termux/files/usr/etc/apache2/httpd.conf`
### Troubleshooting
Apache & PHP- PHP isn't loaded, just showing the code
| Like This |
| -------------------------------------------------------------------------------------------------------------------- |
|  |Open apache configuration on PATH `/data/data/com.termux/files/usr/etc/apache2/httpd.conf`
Give comment (#) this text
| Comment Text |
| ---------------------------------------------------------------------------------------------------------------------------------------- |
|  |```bash
64 ...
65 ...
66 ...
67 LoadModule mpm_worker_module libexec/apache2/mod_mpm_worker.so
68 ...
69 ...
70 ...
```Uncomment this text
| Uncomment Text |
| --------------------------------------------------------------------------------------------------------------- |
|  |```bash
63 ...
64 ...
65 ...
66 #LoadModule mpm_prefork_module libexec/apache2/mod_mpm_prefork.so
67 ...
68 ...
69 ...
```Add module on last configuration
| Add Module |
| --------------------------------------------------------------------------------------------------------------- |
|  |```bash
536 ...
537 Include etc/apache2/conf.d/*.conf
538 ...
539 # Add module for PHP 8
540 LoadModule php_module libexec/apache2/libphp.so
541 AddHandler php-script .php
```This module for PHP Version 8
Now restart apache with `killall httpd`
| PHP success loaded |
| ----------------------------------------------------------------------------------------------------------------- |
|  |
MySQL- Can't login root user because the password didn't know
to fix this, Enable MySQL service
| Enable MySQL Service |
| --------------------------------------------------------------------------------------------------------------------- |
|  |After enable MySQL Service, now login mysql with root user.
```bash
$ mysql -u $(whoami)
```After login, type this on MySQL (To use database mysql)
```bash
MariaDB [(none)]> use mysql;
```Database changed
```bash
MariaDB [(none)]>
```To
```bash
MariaDB [(mysql)]>
```Now setting your root password MySQL you want, with
```bash
MariaDB [(mysql)]> set password for 'root'@'localhost' = password('your_password_here');
```After setting password for root login, type
```bash
MariaDB [(mysql)]> flush privileges;
```Exit MySQL, type
```bash
MariaDB [(mysql)]> exit; # or quit;
```Now your root password has been changed, to login type
```bash
$ mysql -u root -p
```The password column filled with the newest password
| Picture |
| --------------------------------------------------------------------------------------------------------------------- |
|  |
phpMyAdmin- mysqli::real_connect(): (HY000/2002): No such file or directory
| Can't Login |
| -------------------------------------------------------------------------------------------------------------------------- |
|  |If you get this error, the solution is change value on file `/data/data/com.termux/files/usr/etc/phpmyadmin/config.inc.php`:
```php
$cfg['Servers'][$i]['host'] = 'localhost';
```to
```php
$cfg['Servers'][$i]['host'] = '127.0.0.1';
```- Access Denied 403 Forbidden
| 403 Forbidden | lamp check phpmyadmin |
| ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
|  |  |If you get this error, change this text on apache configuration `/data/data/com.termux/files/usr/etc/apache2/httpd.conf`
| Require all denied |
| --------------------------------------------------------------------------------------------------------------- |
|  |```bash
225 ...
226 ...
227 ...
228
229 AllowOverride none
230 Require all denied
231
232 ...
233 ...
234 ...
```To
| Require all granted |
| --------------------------------------------------------------------------------------------------------------- |
|  |```bash
225 ...
226 ...
227 ...
228
229 AllowOverride none
230 Require all granted
231
232 ...
233 ...
234 ...
```Change Require all `denied` to Require all `granted`
Don't forget to restart apache with `killall httpd`