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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:18:40+00:00 2026-05-28T00:18:40+00:00

I have compiled a matlab script into a standalone win app and also a

  • 0

I have compiled a matlab script into a standalone win app and also a console app. The script can be called from the command line using image_process pic1.png. The exe runs and produces a string as a result.
No I want to deploy it in php. I have added a folder to my main website directory called uploads. I need to run php to call the matlab exe to run on the images inside this folder.

Now I go to my PHP script. I define my uploads directory :

define("UPLOAD_DIRECTORY","./uploads"); // defines the uploads directory

then I add the path to my image processor:
define(“IMAGE_PROCESSORE”,dirname(dirname(FILE)).”/image_process.exe”);

at last I configure my process like :

case "process":
    $res=array();
    $pic=isset($_REQUEST["pic"])?trim($_REQUEST["pic"]):"";
    if($pic==""){
        echo "No picture name is passed";
        exit();
    }
    exec(IMAGE_PROCESSORE.' "'.realpath(UPLOAD_DIRECTORY).'" '.$pic,$res);
    //exec(IMAGE_PROCESSORE." ".$pic,$res); // this one if I define the image_process.exe inside the uploads folder
    echo"<pre>";
    print_r($res);
    echo"</pre>";
break; 

So when I call my php like :

localhost/mysitename/phpresponse.php?act=process&pic=pic1.png

I will get no output, but If I run

localhost/mysitename/phpresponse.php?act=process&pic=c:\xampp\htdocs\mysitename\uploads\pic1.png

The matlab compiled file will run and execute

I am really confused, I did try many things but with no luck…

  • 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-28T00:18:41+00:00Added an answer on May 28, 2026 at 12:18 am

    I did find a solution. I have made the script call 2 arguments and then instead of using exec i used passthru to execute the compiled matlab script. I don`t know why exactly it worked but at least it did 🙂

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

Sidebar

Related Questions

I have a Matlab function compiled into C library. I am using this library
I have compiled a simple win32 app successfully with bc++ (2 lines excerpt only):
I have a compiled swf file and a I can't edit it , but
I have a compiled .NET assembly with a specific resource file embedded (named 'Script.xml').
I have a mex file (compiled in VS2010, Matlab 2010b) which accepts a variable,
I have a mex64 dll compiled on my machine. I used Matlab 2009b with
I have a C++ file that: starts the matlab engine calls matlab_optimize() (a compiled
I have a jar file I produced from compiled class files using an ant
I have created a standalone application in Matlab, actually it works, it displays the
Basically I have 14800x8 matrix that has been extracted from matlab as CSV file

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.