Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to run PHP on Android [closed]

I've tried to open my PHP script in the built in Android browser, but I only see my code, as text, and the PHP doesn't run. Why is that ?

How can I run PHP on my Android device ? Is there a way to set up PHP and a web server on an Android device ?

like image 796
Slim Shady Avatar asked Mar 27 '16 09:03

Slim Shady


People also ask

Can I run PHP on android?

Install PHP on Android OS Step 1: Install the Termux app on your device. Step 2: After installation of the app, you will see a “$” sign. Type apt update and press the enter key on your keyboard. Step 3: After that, you will see the $ sign again.

Can Chrome run PHP?

As PHP is mainly a web-based programming language, it can be run in Chromebook.

Can you run a PHP file in a browser?

If you want to run it, open any web browser and enter “localhost/demo. php” and press enter. Your program will run.


1 Answers

Okay, this is a bit of a personal recommendation, but I've had success with the free Palapa Web Server (edit: doesn't seem to be on the playstore anymore, but here's the creator's website in case it helps you find it), which is essentially a web / mysql server which runs on Android, which will run your PHP scripts, and it will also work offline.

To use it, install the app, and copy your PHP / HTML files onto your phone. By default, the app uses /sdcard/pws/www/, so if you put your files there, it should pick them up. Then, launch the app, click "Start server", and go to http://127.0.0.1:8080 with your web browser on your android device, and it should work.

Note that setting up PHPMyAdmin (if you need that for managing databases) can be a bit tricky, as you will need to download the extra packages for it.

Let me know if it works for you. (Note: I'm not affiliated with this app, I'm just a mostly satisfied user.)

like image 86
JonasCz Avatar answered Sep 29 '22 00:09

JonasCz