Search code examples
cordovaphonegap-pluginsphonegap-build

PhoneGap/Cordova: How to add PHP support?


I just read that it is indeed possible to use PHP. My question is how to add such support? Is there an API's or plug-ins to add PHP support?

In short, I want to use PhoneGap alongside PHP to develop apps. How?

Specifics

  • I'll use a Linux server & hosting with godaddy, to park my PHP.
  • In addition, I'll use MySQL database
  • The app will send database requests to that server.
  • The server will be sending large amount of data back to the app.

What would be the most efficient "light weight" method to "transfer the data" and requests between the app and server/hosting account?


Solution

  • From http://phonegap.com/about/faq/. The last FAQ reads:

    Q: Can you use PHP/ASP/JSF/Java/.NET with PhoneGap?

    A: A PhoneGap application may only use HTML, CSS, and JavaScript. However, you can make use of network protocols (XmlHTTPRequest, Web Sockets, etc) to easily communicate with backend services written in any language. This allows your PhoneGap app to remotely access existing business processes while the device is connected to the Internet.

    To be a little more clear, If you want to use PHP, it will be on the server, and the server will NOT run on the mobile device (phone/tablet). Again, your PHP server will run in the cloud, NOT on the phone.