PHP Web App - local and online synced versions - php

I developed a PHP driven Web App with a MySQL backend. New requirement is to have it available offline too at a client's office, once there is an lnternet connection, the two should sync so that both local and online versions are the same. Any advice on how best to implement this?

I found MySQL database Master-Master Replication helpful.
https://www.linode.com/docs/databases/mysql/configure-master-master-mysql-database-replication
no need to write code

Related

How to make PHP web application work online and offline?

I am new into web development. I have PHP web application which I created using some Rapid Development Tool. For now I can run it on the server with online database and as well i can run it on my local machine with local database (offline, using XAMPP).
The question is: How to make web PHP application that will be:
stored locally
be able to easily update somehow on different devices
will work with online database when internet is here. Once internet is not here, database will be switched to local one.
databases will be synchronized as well
Is there any software that can handle all of this? Or should I do it manually? Since I am new here, I have completely no ideas on how to realize that.

Working locally on an existing remote Laravel project linked with a database

I have recently joined a project that uses AWS EC2 to deploy a frontend in NodeJS and a backend in Laravel linked to a phpMyAdmin database. My question is simple but I have not found the way to do it despite litteral hours of research.
How can I launch the backend locally and use the corresponding database?
I should add that the database seems to be automatically generated by the Laravel backend and it contains a folder of "mutations".
I am relatively new to php, VMs and Linux overall.
Thank you for your help
This project is probably using mysql or mariadb as database engine.
You must install the engine and export all of data from server and import it in your local database.
If database is on server and you want to connect to that database, it depends on security mechanisms. You must expose the db engine's port in the server and changing your laravel config to use that host for database connection. But I don't recommend that!
If you just want to run backend for personal tests, just setup backend and database engine and run migrations. I can't help you with this step cause I don't know how are deploy operations in your team. If you provide more information, we can help better.

android database with just sqlite

I am new at android.
I have some problems with android database and how to deploy it into a server without develop a web site for the application.
I want to publish this app into google play after a while.
so an online web server is needed.
Locally woking is useless for me.
So my questions are:
1) If and only if with using sqlite database, can i deploy my application into a server to make it accessible ?
2) if sqlite is not sufficient for me , then how can use php & mySQl ? and could you please offer me some a kind of hosting services for android applications?
3) I want to manage sending notifications from the server and provide communications between devices. Is there any service to provide my needs ?
Thank you so much.
No you can't...You need to have separate database(sql server/mysql) for your server. And then write some webservice so that you mobile app can communicate with server database.
SqLite is only for mobile device and no server supports it, APIK.

is it possible to create a system that is connected a website with the same database

Good day. I have a thesis project. it is composed of a webpage created on php and a system using vb.net 2008.
As of now , they are both connected to the same database.
I am wondering if it is possible that if i packaged the system and live the website, will still be connected with one database? Thank you in advance.
If I understand you right (and the question could be better worded), you're asking what happens if you deploy the website on a different server than the one you used to develop it. The short answer is that, unless the machine hosting the database is accessible to the web server host machine, that you would also have to redeploy the database.
In other words, wherever you move the PHP-based website and VB.NET system, they would need to be able to access the machine hosting the database server. Otherwise, I see no issue with them both accessing the same database.

NoSQL Solution for a Hosted Site

I'm operating on a hosted site without the option to install software packages (i.e.; unsupported binaries) and I'm interested in the benefits of NoSQL for a potentially database intensive site.
Are there any solutions of NoSQL that can easily be implemented with little-to-no sysadmin involvement?
Many of the NoSQL databases have hosted versions available.
MongoHQ is an example of one for MongoDB.
Have you thought about using 3rd party hosted DB solutions? For instance Google hosts their App Engine "platform" along with its Datastore. (http://code.google.com/appengine/)
As mentioned there are many hosted solutions that tend to be located on Rackspace Cloud Servers, or Amazon EC2 servers which you should be able to hook into. As a bonus many of them them (at least CouchDB and Mongo) eiher support natively or have extension that allow queries to be made over HTTP which should simplify connecting to them greatly. These hosted solutions manage 99% of the daily (and general) sysadmin faff so that you just worry about creating the database and reading and writing data to it.
(Just don't forget to allow your currents servers IP access to the hosted nosql DB when you wonder why it doesn't work)
CouchDB examples
http://cloudant.com/
http://www.iriscouch.com/
Mongo example
https://mongolab.com/home/

Categories