有什么办法可以在Android上运行PHP [英] Is there any way to run PHP on Android
问题描述
我试图在内置的Android浏览器中打开PHP脚本,但是我只能看到我的代码(文本形式),并且PHP无法运行.为什么会这样?
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 ?
如何在Android设备上运行PHP?有没有办法在Android设备上设置PHP和Web服务器?
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 ?
推荐答案
好的,这是个人的建议,但是免费的这里是创建者的网站,以帮助您找到它),这实际上是一个网站/mysql服务器,可在Android上运行,它将运行您的PHP脚本,并且还可以脱机工作.
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.
要使用它,请安装该应用程序,然后将PHP/HTML文件复制到手机上.默认情况下,该应用程序使用/sdcard/pws/www/
,因此,如果将文件放在此处,则应将其拾取.然后,启动应用程序,单击启动服务器",然后使用Android设备上的网络浏览器转到http://127.0.0.1:8080
,它应该可以正常工作.
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.
请注意,设置PHPMyAdmin(如果需要用于管理数据库)可能会有些棘手,因为您将需要为其下载额外的软件包.
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.)
这篇关于有什么办法可以在Android上运行PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!