Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is there a way in the server-side to execute once an operation instead of execute it every time when I sent a PHP request?
For example, I have an website that makes a lot of requisitions, but its independent from user or anything else, it just depends on the application running in the server with wich I'm willing to manage with my website.
So I want a way to just get the data that I need, processed by a script in the server not by every PHP request, i.e. The server will execute the only once and then I can grab the data with PHP.
As lonut suggested use cronjob (linux) or task manager (windows) to run you PHP task at specific intervals.
You can run standalone php script from the command line by using php path/to/your/script.php
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
My project is using shell script to get RAM and CPU usage on linux.
How can I view these graphically with PHP?
Your question is a bit vague (hence all the downvotes).
It sounds like a) maybe you're on a Linux host, and b) maybe you want to use PHP to dynamically generate a web page.
SUGGESTIONS:
Use /proc, vmstat and iostat to get performance statistics
Use GD and gdchart to render your statistics graphically
Possibly helpful links:
Dynamically Creating Graphs and Charts with PHP and GDChart
8 commands to check cpu information on Linux
Just pick one aspect of the problem (for example, "write a shell script to get current CPU utilization). Get it working. Then pick the next problem. And so on.
Please post back with new questions about specific problems you encounter.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to create a backup script to automatically run 3 times: monday of every week,first day of 1 of each month,and once per 3 months.My logical thinking,isnt that good,so i need your help guys.The code has to be in php,and the easiest way is with if.
You would need to do a cron job or launchd to do the automation but you could have it run your PHP script without a problem. All it would do is a directory recursive iterator to copy and make directories in a backup location. PHP has a ZIP library, if installed on your server, to create compressed files if so desired. See this page. This could be as complex a you make it. You may want to store the files on a remote server which you could use the FTP features in php to send with.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a server at a host, so I can't control the server directly and therefore don't have ability to start Windows cmd or a Linux shell. I want a PHP script on the server to receive data from a incoming connection (client: created with a Python script).
I know about database and so on, but can't find a PHP example, where it's done on a host server with limited control. It seems that all guides are for HTML pages or for use where you have the server in own hands.
If you are trying to receive form data from client then you can use POST or GET method to receive data from client to server.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So I have two ruby scripts that scrape two websites for information based on what it entered via a form. Basically, the form outputs to a file, and the two ruby scripts take their input from that file and proceed to scrape and return a viewable html file. My problem is that I have no idea how to connect the php file to the ruby scripts. When I was writing them, I just tested them via the terminal to ensure they worked correctly. Now that I have everything done, I am lost when it comes how to actually execute the scripts from the php file that writes the user input to file.
You should write a poller in the ruby script that checks the file you write from PHP periodically. There is an issue of concurrency when you are trying to do this: the producer could be writing at the same time the consumer is reading.
I suggest to read and write to DB, so you don't have to worry about it. If you don't want to setup a fully professional DB, you can use SQLite (ruby PHP).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am doing a project on android application developement i need to know hpw does 3 thish work together what are their task when working togeather in as simple language as possible I want it in words so that even a layman would catch it easily!
Something as simple as that
HTTP-client (browser) <--> HTTP server (apache) <--> PHP interpreter <--> Postgres
Client sends request
Apache resends it to PHP
PHP queries PG, gets data, renders it as HTML (or JSON) and returns it to Apache
while Apache sends the response to client
Client renders nicely looking page