Install PHP Web Server on Termux

 Install PHP Web Server on Termux Install PHP Web Server on Termux

connect the previous article about how to install maria db in termux ( Install MariaDB on Termux ), as a complement we will install the apache web server in termux . due to the differences in termux compared to native Linux, the default ports for web servers like 80 etc cannot be used, so later we will use other ports to run the web server .
 Install PHP Web Server on Termux
Install Apache WEb server
to install Apache web server is quite easy, just type
  #apt install Apache2 
wait until the process is complete, if it's already running it it's easy enough. all we need to do is type the command.
  #php -S ip: port -t /path/to/web/file.php 
where ip is the ip address of the web that we want, the port is the port we want to use as an http port, if by chance port 80 is not used it can use port 80, and /path/to/web/file.php is the directory of the php file that we want to run.
suppose I have a file at /sdcard/www/html/index.php. then the ip address of my cellphone on the WLAN network is and I want to use port 8080 as the port just type
  #php -S -t / sdcard / www / html / index.php  
to try it just type in the android browser localhost / index.php or if you happen to be connected to the network can use the direct ip address, and try accessing it from another cellphone or computer. if it happens to not have a LAN / Wifi network then ip can be filled with
maybe this is what I can share , in the next article I will discuss about ssh server in termux, so we can tamper with console thermux directly using the ssh server . it can even be used for debugging when we develop applications on Android.
see you in the next article