Is there a terminal emulator for Android which allows to use vi and php with mysql support? PS. Termux unfortunately doesn’t allow to connect php to the mysql.

3 Answers 3


Late to the party, however, if I install the php package:

pkg install php

then navigate to my directory containing my php files,

cd storage/<php directory>/

I can then prefix commands with ‘php’. So, to run a file in my php directory:

php -f php_file.php

There is more information in the ‘man’ doc - “man php”. I use DroidEdit, which works well; I have not tried using vim, but I see no reason why it would not work, so long as your current directory is the one containing the php files.

As to whether you can configure the application to use Lavarel, I’m sorry, but I do not know.

  • what terminal emulator are you talking about? If termux, then there was no mysql support for php supplied by termux.
    – zhekaus
    Commented May 23, 2018 at 19:22
  • I am using Termux; I am also using Mariadb and php, both from the Termux pkg mngr. I also installed Adminer (from its site), which gives a GUI for the database. All wotk, but currently, my Adminer installation has a problem, so I have no connection to the localhost.
    – Den
    Commented May 24, 2018 at 21:26
  • When I was tried php on termux, there was no compiled mysql library for php.
    – zhekaus
    Commented May 25, 2018 at 4:49
  • The closest I’ve got to MySQL is MariaDB, which you can install from Termux. In conjunction with Adminer adminer.org you will have a working database. There are instructions available for set up of both utilities; I used this: youtu.be/AYLy2kWGN_I; set the subtitles to your language. The follow-on video deals with Adminer.
    – Den
    Commented May 27, 2018 at 1:04

In order to do this you will need to have su or root on your phone,

Because in the Android OS each app runs under its own user, (not to mention selinux) which is why you need root to change a apps data manually (commonly known as "cracking" or "hacking").

You can easily find php/mysql binaries to install after you get root.

Which should be moved under /system/bin

  • I don't want to root my phablet. I'm looking for alternatives such as termux. It has a bunch of packages such as php and sqlite. But I need mysql...
    – zhekaus
    Commented Mar 29, 2017 at 12:08

What you want is more than a terminal emulator. The way PHP scripts connect to a database server is entirely outside the control of the terminal. There are a couple of "server pack" apps in the Play Store that include services like MySQL and SSH. I can't recommend a particular one, but if you search for MySQL on Play Store you'll get a lot of results.

  • I have such packs. There is no problem in running php server or mysql on android. I want to use Laravel php framework. To use it I need php in command line.
    – zhekaus
    Commented Apr 2, 2017 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .