Here are some details about last version i use
- PHP
8.0.2
- MariaDB
15.1 Distrib 10.5.8-MariaDB, for Android (armv7-a)
- Apache
2.4.46 (Unix)
- phpMyAdmin
5.0.4
PHP | MariaDB | Apache | phpMyAdmin |
---|---|---|---|
If you want to see size package installation, run ./package.sh
Package Size |
---|
- URL Apache
http://localhost:8080
- Default Port Apache
8080
- Default MariaDB User
mysql -u $(whoami)
- htdocs PATH
$HOME/apache
Termux (Android)
-
$ pkg update && pkg upgrade
-
$ pkg install ncurses-utils git
-
$ git clone https://github.com/xshin404/lampTermux
-
$ cd lampTermux
-
$ chmod +x install.sh
-
$ ./install.sh
Service
- Apache
Script PATH on /data/data/com.termux/files/usr/bin/lamp
Enable Apache Service | Disable Apache Service |
---|---|
- MySQL
Enable MySQL Service | Disable MySQL Service |
---|---|
Web Server Status
- Index Apache & phpMyAdmin
Script PATH on /data/data/com.termux/files/usr/bin/lamp-check
No Error | Error 403 Forbidden |
---|---|
Apache
- htdocs
Custom PATH 'htdocs' |
---|
Default PATH htdocs on
246 ...
247 ...
248 ...
249 DocumentRoot "/data/data/com.termux/files/usr/share/apache2/default-site/htdocs"
250 <Directory "/data/data/com.termux/files/usr/share/apache2/default-site/htdocs">
251 ...
252 ...
253 ...
my configuration
246 ...
247 ...
248 ...
249 DocumentRoot "/data/data/com.termux/files/home/apache"
250 <Directory "/data/data/com.termux/files/home/apache">
251 ...
252 ...
253 ...
- Custom extension file that will be at loaded first
Custom extension file |
---|
Default extension file is
279 ...
280 ...
281 ...
282 <IfModule dir_module>
283 DirectoryIndex index.html
284 </IfModule>
285 ...
286 ...
287 ...
my configuration
279 ...
280 ...
281 ...
282 <IfModule dir_module>
283 DirectoryIndex index.php
284 </IfModule>
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
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 |
---|
67 ...
68 ...
69 ...
70 LoadModule mpm_worker_module libexec/apache2/mod_mpm_worker.so
71 ...
72 ...
73 ...
Uncomment this text
Uncomment Text |
---|
66 ...
67 ...
68 ...
69 #LoadModule mpm_worker_module libexec/apache2/mod_mpm_worker.so
70 ...
71 ...
72 ...
Add module on last configuration
Add Module |
---|
536 ...
537 ...
538 ...
539 LoadModule php_module libexec/apache2/libphp.so
540 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.
$ mysql -u $(whoami)
After login, type this on MySQL (To use database mysql)
MariaDB [(none)]> use mysql;
Database changed
MariaDB [(none)]>
To
MariaDB [(mysql)]>
Now setting your root password MySQL you want, with
MariaDB [(mysql)]> set password for 'root'@'localhost' = password('your_password_here');
After setting password for root login, type
MariaDB [(mysql)]> flush privileges;
Exit MySQL, type
MariaDB [(mysql)]> exit; # or quit;
Now your root password has been changed, to login type
$ mysql -u root -p
The password column filled with the newest password
Picture |
---|
phpMyAdmin
- Access Denied 403 Forbidden
403 Forbidden | lamp-check |
---|---|
If you get this error, change this text on apache configuration /data/data/com.termux/files/usr/etc/apache2/httpd.conf
Require all denied |
---|
229 ...
230 ...
231 ...
232 <Directory />
233 AllowOverride none
234 Require all denied
235 </Directory>
236 ...
237 ...
238 ...
To
Require all granted |
---|
229 ...
230 ...
231 ...
232 <Directory />
233 AllowOverride none
234 Require all granted
235 </Directory>
236 ...
237 ...
238 ...
Change Require all denied
to Require all granted
Don't forget to restart apache with killall httpd