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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:15:31+00:00 2026-05-16T06:15:31+00:00

I have a file named gcc.exe and I have a php page… I want

  • 0

I have a file named gcc.exe and I have a php page…
I want to use:

gcc test.c

And, if there’s some compilation error, I want to show it on the php page…
But I can’t.
What happens is: If the file is correct, it generates the .exe file,
but if it’s wrong, nothing happens. What I want here, again, is to show all errors.

Anyone has an idea?

Edit[1]:
Some code:

<?php
exec("gcc teste.c",$results);
print_r($results)
?>

Output:

*Nothing*

Edit[2]:
I tryed put gcc output on a text file:
This way (on prompt):

gcc test.c > teste.txt

Teorically, everythings on the screen go to text file.
But this was unsucessfuly!

Edit[3]: quantumSoup:
I tryed it, and…

array(0) { } int(1)

Nothing… Anything more?

  • 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-05-16T06:15:32+00:00Added an answer on May 16, 2026 at 6:15 am

    gcc is likely to generate error output on stderr, which it would appear exec doesn’t capture in the $results array. Solutions to this are likely to be kinda platform-specific. If you’re working in a unix-like environment, it would be possible to do something like gcc foo.c 2>&1 to redirect stderr to stdout. I’ve no clue how one might achieve that on Windows, or if analogous concepts even exist. Perhaps someone else can elaborate if your question is platform-specific.

    This is supported by the fact that piping to a file didn’t work either.

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

Sidebar

Related Questions

I have a resource file named filetypes.resx. Some how I figured out to bind
i have a source file for d named dprogram.d and use the command $
I have a file named my file.pdf and I can't delete this file with
I have a file,named f1.txt, whose contents are 75 15 85 35 60 50
I have a file named file with three lines: line one line two line
I have a file named configuration.xml which resides in classes folder of my WEB-INF
Let's say I have a file named output1 How to match just digits form
I have a txt file named 'a.txt' with the following content: Hi=Python Now, I
I have a jar file named umar.jar in /root/umar/bin directory. I have a shell
I have created a file named MyFile.db using SQLite3 from my C#.net application. 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.