项目作者: xshin404

项目描述 :
LAMP on Android
高级语言: Shell
项目地址: git://github.com/xshin404/lampTermux.git
创建时间: 2021-03-04T15:10:02Z
项目社区:https://github.com/xshin404/lampTermux

开源协议:GNU General Public License v3.0

下载




xshin404/lampTermux

Installation

  • Download or clone the latest release.
  1. git clone https://github.com/mayTermux/lampTermux
  • Move to directory
  1. cd lampTermux
  • Run installer script
  1. ./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 |
| ————————————————————————————————————————————————————————- | ————————————————————————————————————————————————————————————— | —————————————————————————————————————————————————————————— |
| phpinfo | phpmyadmin-login | phpmyadmin |



User Configuration


Apache

- htdocs

| Custom PATH ‘htdocs’ |
| ———————————————————————————————————————————————————————- |
| image |

Default PATH htdocs on

bash 246 ... 247 ... 248 ... 249 DocumentRoot "/data/data/com.termux/files/home/htdocs" 250 <Directory "/data/data/com.termux/files/home/htdocs"> 251 ... 252 ... 253 ...

- Custom extension file that will be at loaded first

| Custom extension file |
| ———————————————————————————————————————————————————————- |
| image |

Default extension file is

bash 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

Troubleshooting


Apache & PHP

- PHP isn’t loaded, just showing the code

| Like This |
| —————————————————————————————————————————————————————————— |
| phpnotload |

Open apache configuration on PATH /data/data/com.termux/files/usr/etc/apache2/httpd.conf

Give comment (#) this text

| Comment Text |
| ———————————————————————————————————————————————————————————————————— |
| Screenshot_2022-09-12_21-49-06 |

bash 64 ... 65 ... 66 ... 67 LoadModule mpm_worker_module libexec/apache2/mod_mpm_worker.so 68 ... 69 ... 70 ...

Uncomment this text

| Uncomment Text |
| ———————————————————————————————————————————————————————- |
| image |

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 |
| ———————————————————————————————————————————————————————- |
| image |

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 |
| ————————————————————————————————————————————————————————- |
| phpload |


MySQL

- Can’t login root user because the password didn’t know

to fix this, Enable MySQL service

| Enable MySQL Service |
| ——————————————————————————————————————————————————————————- |
| mysql-start |

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 |
| ——————————————————————————————————————————————————————————- |
| setpassword |


phpMyAdmin

- mysqli::real_connect(): (HY000/2002): No such file or directory

| Can’t Login |
| ————————————————————————————————————————————————————————————— |
| phpmyadmin-error |

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 |
| ——————————————————————————————————————————————————————————————— | ————————————————————————————————————————————————————————————— |
| phpmyadmin-forbidden | phpmyadmin-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 |
| ———————————————————————————————————————————————————————- |
| image |

bash 225 ... 226 ... 227 ... 228 <Directory ></Directory> 229 AllowOverride none 230 Require all denied 231 </Directory> 232 ... 233 ... 234 ...

To

| Require all granted |
| ———————————————————————————————————————————————————————- |
| image |

bash 225 ... 226 ... 227 ... 228 <Directory ></Directory> 229 AllowOverride none 230 Require all granted 231 </Directory> 232 ... 233 ... 234 ...

Change Require all denied to Require all granted

Don’t forget to restart apache with killall httpd