I have a server:
ubuntu, running Xampp.
multiple clients:
Raspberry pi, running Apache
all connected via LAN network
I have a PHP code on the server that does the following:
gets information from the database
write it in json files
Accepts REST API request and sends response
on the client side, a php code that does:
send REST API calls
gets the response and write it to a text file
The database might be updated anytime, and the json files will be updated accordingly.
I want the clients to execute the code whenever the json files are updated.
Is there any way to make the clients monitor these files?
or make the server send a signal to all clients when the files are updated?
Related
I saw a question similar however the answers were irelevant to what I'm trying to achieve. Given that I have a local media server (for example Wowza) how can I use another server to pipe the requests to my local wowza server?
I'll expand. Given I have an application which sends live video feed to a webserver which runs apache server I'm looking for a script (prefebly php) to recieve this data and send it to another server which has wowza. (so basically act like a proxy)
ADVANCED:
I was also looking for a little more advanced solution if possible. If I open the webserver (send a request) I want it to start sending data to my local wowza server given it knows the right port
Using eclipse i create a simple abdroid application which communicate with MYSQL data base using PHP scripts, i start writing my PHP Web Service and i put those files under 'www' of my Wamp server.
in fact Wamp server is using two servers
1.web server ( Apache)
2.Mysql
after doing those steps i run my android application under eclipse ide and i get all things works..
I m trying to understand the process behind all that.
My Android application by runnig send an HTTP request to the PHP web service, then ,the apache Web server in Wamp Server executes the php script and do some oparation on the data base ,after that the result is reterning to the Android application ( the result in Json format), and finaly the application decode the Json object and display the result
is it right? please correcte me if i m wrong
This is correct if you want it to be a simple request-driven web service (such as HTTP in your case).
I have a Ubuntu Server on which I have my Apache and FTP server (I am using Proftpd server). I have a small PHP CMS and for database I am using MySQL server. This was my server side environment. Now on client side I have a C# ftp client which I use to download the file from FTP server. Also, this C# client communicates with my PHP CMS.
So in short there are two communications occurs at a time
1. C# client and FTP server for file transfer.
2. C# client and PHP CMS for some other work.
So, now what I want is real time progress (progress bar) of my ftp transfer on one of my CMS webpage.
Obviously one of thing I can do is that I can tell my C# client to upload it's download progress to PHP server using some web service or web socket and then I can show the progress of ftp transfer(basically progress of downloading of C# client).
But before doing this I just want to know that is it possible for my PHP server to check what FTP server is doing. Since, no communication occurs between them I don't know how to accomplish it? I have a MySQL server and I know that proftp can communicate with MySQL server and it has some predefined table in which I can store whatever is ftp server doing. But will it possible to use it to show a real time progress? Is their any other technique to do this or will I have to force my C# client to do it?
From what you say, you have no need to talk to the FTP server at all (except to download the file, of course). Your FTP client could upload the FTP transfer status to a Web socket (and why could it not display it directly?), there to be recovered by the CMS and shown in the page. By using sessions, you do not even need to actively save that information anywhere, provided the Web socket call properly initializes the session cookies.
In the FTP client download callback function just add a call to send the progress status to the server. There, a scriptlet will save it into, say, $_SESSION['download_status']. An AJAX call on the CMS page can then retrieve it and display it periodically.
Don't forget to also upload FTP session and exception status (transfer interrupted, etc.).
I have a server client application. In this my server is php based application on a central location and clients are local servers developed in php and located at individual machine.
I have aGUI on my central server where i selects the local clients and sends the string message to them using webservice which is their on each local machine. Currently it is like when i clicks on send button it takes ip of each local machine from database and calls the webservice in for loop but it takes lots of time for looping if i selects more local clients. So how can i tell my central server to do this work in background
You can use a job queue like BeanStalk
I wanted to know if I am accessing a website using my curl script, will the TCP connection be initiated from the client who has opened the PHP page (that is my PC) or the server where the PHP page is hosted?
Is there any way to verify this ? I tried to open whatismyipaddress.com using my curl script to check what IP address it is showing but it did not show any IP address thinking the request came from a BOT.
It will be from the server. Curl is an executable binary on the server and will execute as such. If you choose to display any output the server will push that output back down to the client.
The client only receives HTML code generated in your server so, all happens in your server and therefore the connection is opened from your server.