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 7823191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:09:38+00:00 2026-06-02T08:09:38+00:00

Basically my situation is as follows. Upload file Run external process on file (which

  • 0

Basically my situation is as follows.

  1. Upload file
  2. Run external process on file (which generates another file)
  3. When external process is down, process the generated file.

Currently in PHP I run the program as follows:

$cmd = 'cd the_directory/; ./the_program'
system($cmd);

The program runs fine and everything, but the program at the end says “Press Enter to exit…” And thus Apache is hanging indefinitely as this program is waiting for user input. Our partner declares that they have this program integrated into their backend flawlessly and does not experience this issue. Up until now all external programs that i have executed in PHP exit without requiring user input which seems to be the norm for this situation.

It seems to me that the code should just simply not have the end message requiring user input. Am I missing something? Or is there a way to get around this? Or do they just need to change their code?
Thanks!

  • 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-02T08:09:40+00:00Added an answer on June 2, 2026 at 8:09 am

    I think you should try proc_open.

    With it you can not only execute an external command as a process, but also set pipes to get and send information to that process.

    Take a close look to the third parameter of this function, and study the example in the PHP manual for this function, where you can see something like this:

    fwrite($pipes[0], '<?php print_r($_ENV); ?>');
    

    so, you can write what you need to the input pipe of the process you’ve just opened.

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

Sidebar

Related Questions

I'm currently in a situation where we are creating a facade database which basically
We've run across a slightly odd situation. Basically there are two tables in one
I need a solution for a specific situation. I have an algorithm which basically
I have a situation where I have two elements, which are as follows in
Basically I want to run a script checking for the existence of a certain
Basically I am wondering if it is possible to run a console script (.sh)
Basically I attempt to have a link slide down a div. This is fairly
Basically, my situation requires me to check to see if the String that is
The Situation I have a table in a DB that contains job types, basically
Basically the situation is like this (simplified, pseudo code): I have 2 TABLES person

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.