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

  • Home
  • SEARCH
  • 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 7847409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:53:07+00:00 2026-06-02T17:53:07+00:00

I have an exe file which has the following code: while(1) printf("hello\n"); I’m executing

  • 0

I have an exe file which has the following code:

while(1)

printf("hello\n");

I’m executing this exe through php using shell_exec

$output = shell_exec(‘C:/Users/thekosmix/Desktop/hello.exe 2>&1’);

echo $output;

now the script is executing for very long time untill i kill the process from task manager and it gives fatal error:

(Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 133693440 bytes) in C:\xampp\htdocs\shell\index.php on line 7)

I want the script (or this function) to run for a given time duration and print whatever output is generated during the time-duration not any fatal error. set_time_limit() is also not solving the problem.

  • 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-02T17:53:09+00:00Added an answer on June 2, 2026 at 5:53 pm

    You can’t do this from within PHP – set_time_limit() is only checked after each PHP statement gets executed. Under linux you’d use ulimit, but it looks like you’re using Windows.

    You’ll need to either modify the hello.exe executable to build in a timeout, or write a wrapper that you call from PHP, which call hello.exe and handles the timeout. In any language that can easily fork, this is trivial.

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

Sidebar

Related Questions

I have a Windows batch script (my.bat) which has the following line: DTBookMonitor.exe 2>&1
I have an exe file which runs OK when I double clik on it
I have an EXE file using a DLL file which is using another DLL
i have published my project and exe file has been created.... now i want
I have the following code which works well on another server. The problem is
I have the following code which assembles and runs fine on Windows XP 32
I have an existing C# application that has a manifest file which is embedded
Sorry if this question has been asked many times. I have a DOS .exe
I have an exe file simpleservice.exe in the physical path F:\SAMPLEPRODUCT\Bin ,, i need
I have a compiled .exe file (compiled with gfortran and -g option) that crashes.

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.