Jump to content

Compile an exe in realtime using PHP on the server


RapidPHP

Recommended Posts

I wondered if anyone could help shed some light on something I am trying to achieve,

 

I will try and explain as clearly as I can.

Basically using PHP I would like to be able to compile an exe (windows executable)

programmatically on the server in real-time, I know this is possible, but at the moment

am not quite sure how.  To explain; basically we will have a file on our server,

and when the customer has made a successful payment online, using PHP we would

programmatically add a unique code to this file and then compile it to produce a

unique executable (something.exe) in realtime for them to download and install on a Windows PC. 

I hope this makes sense, can anyone help?

Link to comment
Share on other sites

Thank you for your help.

 

The part I am struggling with is:

I need to embed a pre-created text file (customer.txt from the server) into an executable,

this executable when ran on a Windows PC must then place the embedded

text file into a specified location e.g. "C\Program Files\Something\customer.txt"

 

So my problems are:

1) To embed a text file into an executable. (programmatically in real-time on the server)

and

2) I need to program the exe to place this file somewhere when ran.

 

Can anyone help in this area?

Link to comment
Share on other sites

Neither of these is in scope of PHP.

1) PHP can fwrite a file for you, but it's your compiling environment that should grab it and use it for compilation.

2) This is done by your program, so PHP has nothing to do with it.

Link to comment
Share on other sites

Neither of these is in scope of PHP.

1) PHP can fwrite a file for you, but it's your compiling environment that should grab it and use it for compilation.

2) This is done by your program, so PHP has nothing to do with it.

 

Couldn't PHP automate the process a bit though? For example, if you had a compiler locally, you could use PHP to initiate the compiler and send the executable to the browser for download?

 

Could be wrong, though.

Link to comment
Share on other sites

Neither of these is in scope of PHP.

1) PHP can fwrite a file for you, but it's your compiling environment that should grab it and use it for compilation.

2) This is done by your program, so PHP has nothing to do with it.

 

Couldn't PHP automate the process a bit though? For example, if you had a compiler locally, you could use PHP to initiate the compiler and send the executable to the browser for download?

 

Could be wrong, though.

 

That is precisly what Mchl pointed out, the rest of the OP's question however is not at all php related.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.