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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:30:57+00:00 2026-06-14T11:30:57+00:00

I’m currently trying to get an executable to run from within a PHP web

  • 0

I’m currently trying to get an executable to run from within a PHP web page (currently using exec()). The program takes two arguments when run from the command line; I’m not sure what the best method would be to run it with PHP.

In particular, the .exe can be run from the command line using the syntax:

my_program.exe input_file_name.txt / output_file_name.txt

The program processes the data in the input file and puts the processed into into the output file. This all works fine from the command line (in Windows). The .exe is written in Visual Basic (it wasn’t written by me).

I know I can normally give exec() a parameter by doing something like:

exec('my_program.exe "example input parameter"');

if the .exe is written to take input from argv(), which I’ve done for testing. I tried a few things like:

$argument = "C:\wamp\www\web_dev\test\input.txt / C:\wamp\www\web_dev\test\output.txt";
exec('C:\wamp\www\web_dev\test\my_program.exe $argument');

Which didn’t work out. (I’m currently trying to get it working on my localhost, in case that’s pertinent..)

I believe, since the .exe does all the work of opening, writing to, and closing the input and output files, that I just need to figure out how to code a PHP command that will execute the program in the appropriate fashion.

I’ve seen similar threads to this one, so I hope I’m not re-asking anything; I wasn’t able to find a thread that quite pertained to this situation.

Edit: if it helps, the overall scope I’m working towards is to create a web interface that allows a user to upload a file, then invokes the executable I’ve been given (which was given to me with the command-line instructions mentioned above) on it and produces an output file for the user with the processed data.

  • 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-14T11:30:58+00:00Added an answer on June 14, 2026 at 11:30 am

    basic PHP syntax error: you’re using the wrong quotes. Use double-quotes instead.

    exec("C:\wamp\www\web_dev\test\my_program.exe $argument");
         ^---                                              ^---
    

    single quotes (') do NOT interpolate variables into the string. You’re trying to pass a literal $, a, etc… as an argument, not the value of that variable.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.