0

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.

1

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.

4
  • what terminal emulator are you talking about? If termux, then there was no mysql support for php supplied by termux.
    – zhekaus
    May 23 '18 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
    May 24 '18 at 21:26
  • When I was tried php on termux, there was no compiled mysql library for php.
    – zhekaus
    May 25 '18 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
    May 27 '18 at 1:04
0

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

1
  • 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
    Mar 29 '17 at 12:08
0

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.

1
  • 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
    Apr 2 '17 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.