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).
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
I would like to know if it's possible to run a executable file (through any technology; PHP, JS, HTML...) on the web server, and render the image on the client.
I would like to do that to not share the exe file, but just let the client see what how the programm looks like without having him to download it. Also, using that way it won't affect the client PC.
It is possible to run application on server side and display result of application to client [1]. However, if your application uses GUI it might be difficult and required complex solution.
What if you:
Display screenshots of application
Let user book some online meeting where you would present the application through skype with shared desktop
Have public server where application would be installed and user could request username/password to server and try it itself (think about security!)
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 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
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am accessing my remote server directory(/var/www) using the tool WINSCP. When I need to update a PHP file on the remote server, I work on a copy on my laptop (Windows 7), then I upload that copy to the corresponding directory at the remote server (by clicking right click on the file on the laptop directory, then I chose upload from the menu, then from the prompt I chose move and replace).
My question, during the transfer process, assume there is a user is using the system and he made a process was not done yet (let us say a process in mysql was working) and suddenly the PHP file is replaced with another one during the process. Will this make problem for my application? Is it healthy? Will it stop or a corruption will happen to database?
Shall I kick out all users before replacing PHP files at remote server? (that would be so hard option).
PHP read the whole script before running it, so replacing the file will have no effect on this, you can keep doing it like that.
If you have multiple PHP files and you are changing the API between them (add parameters to functions in your lib, for instance), you could run into trouble.
Same is if you use a database and you have to update your table definition.
As long as only a single PHP file changes, you are completely safe.
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 am doing a php program which requires doc file to be saved after every 10 secs.msword should not ask the path to be saved. actually i have written a program which opens a doc file. the file should be auto saved to the exact location from where the file is opened.
If I understand you correctly, what you want to do is not possible (sadly).
There is no standard or protocol for live editing of remote files that have been downloaded from a web page in a browser. The file will be downloaded to a temporary location and opened from there.
Hence, any notion of providing an auto-save mechanism from PHP or JavaScript is completely impossible. The client application will have to do that.
If you want to upload the downloaded and locally edited file back to the web site, you will need to provide an upload form for the user to do it manually. (Which is a shame and completely unintuitive, but that's the way technology is at the moment.)
Not possible due to security reason in web technology.