Install web server and process PHP files: build a LAMPP stack on Android
This is not a post of those who use tricks to attract visitors, we are really going to install an Apache server on Android, configure it to process PHP files and finally write a Hello World: everything running from our mobile device.
Android mobile devices are not designed to be servers (although some of them are powerful), however it is always interesting to see how technology advances and day by day we can do more things with our phones.
Today we will see how to install the MySQL or MariaDB server on Android, thanks to the Termux application. For that it is enough to execute a few simple commands and voila, we will have a MySQL database server in our Android; fully functional and ready to execute queries.
If we want to put it for production, we can do it as long as we configure security. In short, we will not see more advanced topics; we will only see how to install mysql on Android.
Here we will use MariaDB and MySQL as synonyms; that is, if you see that I say MariaDB do not get confused, I mean MySQL; and vice versa.
I know that there are really more differences especially with the licenses, but that is another topic and you can search it in Google if you wish.
Today we will see how to install and configure Termux on Android, as well as a brief introduction to its use.
Termux is an application that will allow us to have a terminal on our device, but apart from that it gives us the possibility of installing very interesting packages; and if we configure them well and install well, we can have a complete and stable server on our mobile.
This application does not require root access, you only need that our Android phone has a recent version (I think it works from Android 6).
Today we will see how to convert a string in C to uppercase. We will also see how to convert a string to lowercase. That is, to convert something like “Hello World” to “hello world”. Or something like “Good night” to “GOOD NIGHT”.
For this we will use some functions that the standard library has: tolower and toupper.