AKB's avatar
Level 1

How can I execute my own .exe (Windows) and get output into Laravel

Hi there.

I'm currently evaluating Laravel for a new set of web services that we which to develop. We have a fledgling "old style" php 5.6 system that, on file upload from a client, uses exec() to call a utility .exe asynchronously to process the file and generate an output file. When the client calls us back at a later time, we provide that file to them in the response.

I would like to know if there's a more eloquent (Not Eloquent :)) way of doing this in Laravel? I would love to be able to just run a job and that job automatically pulls from the generated file (or even better, STDOUT) of the application and it ends up in Laravel as some variable that I can just send back in a response.

Thanks Aaron

0 likes
4 replies
wilburpowery's avatar

A job sounds fine for me really. If the basic idea behind it is creating and manipulating a file, Laravel uses the Flysytem package. It's really awesome.

AKB's avatar
Level 1

Thanks.

How can one execute an .exe job though and get the results? I've only seen jobs being executed with more complex providers like Redist etc. Excuse the newbie questions here, I only discovered Laravel yesterday. Do you know of any example code anywhere?

Thanks

AKB's avatar
Level 1

Thanks.

I understand how exec() works. What I'm saying is how to make that an async Laravel compatible job that is queued in the job system, and the output ends up (preferably via streaming STDOUT as I'd like to avoid a file if I can) into some other object in PHP. From what I saw of the job docs, you have to have special providers for different things and only Redist, DB etc are offered, not command line execution and output capturing.

Thanks

Please or to participate in this conversation.