Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7965045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:03:10+00:00 2026-06-04T06:03:10+00:00

I have a computational terminal program that I need to interact with using a

  • 0

I have a computational terminal program that I need to interact with using a php webpage. I can do this in JAVA using getRuntime().exec(…) and then creating pipes that read from and write to the process, and the process will exist between requests. But I am not sure if it can be done with PHP as I dont think proc_open keeps the process alive during requests?

Here is the flow of the webpage I am creating. First the user will enter a command on the webpage, which will be fed to a the terminal program that performs the computation and then the answer is returned to the user. I will use AJAX for the request so that the answer is returned without refreshing the page.

Now my issue is that I need to interact with the same process on the next request rather than start a new one. This is because the terminal program has state. That is I can set variables in it like this – X = 5;

So on my first AJAX call to the program I pass

X = 5;

and the output from the program that is returned to the user’s browser is –

X = 5

Then on my next AJAX request I pass

Y = X + 5;

and then the program should output

Y = 10

which gets passed back to the users browser.

But it is my understanding the the proc_open function does not maintain state between requests. I understand that the process is closed when the server responds to the user’s request. Is this correct? And if so is there any way to do what I need to do using PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:03:11+00:00Added an answer on June 4, 2026 at 6:03 am

    You’ll want to look into $_SESSIONs. Since PHP doesn’t have a concept of maintaining state sessions, this is how you can pass information from request to request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have noticed that I can use memory blocks for matrices either allocated using
I have a structure that can be very easily represented using a three-deep nested
I have designed a user interface for my computational software using swing (Java). I
I have a computational geometry problem that I feel should have a relatively simple
I have a computational intensive project that is highly parallelizable: basically, I have a
I have a computational process that takes quite a bit of time to perform
I have a computational algebra task I need to code up. The problem is
That is, the computational complexity. Does it have to count all the elements? Does
I'm wondering about computational efficiency. I'm going to use Java in this example, but
I have a action.php script from where I call a python script like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.