简体   繁体   中英

running exe app using php exec funtion make the page hangs

I am using apache server under xampp. I have some matlab exe file that I want to execute. I used this template

$tmp = exec($command, $output, $return_var);

while $command contains the exact command to execute the file using cmd.

What is happening is the page hangs and when I debug, I found that the server hang while calling this exec command.

I searched the web and tried many things like run the Apache service and my user account and give the user all administrator privileges, but unfortunately it still stuck.

Any help or advice would be appreciated.

The problem with my code was because the Matlab code is accessing file system and also reads an excel sheet. So, it was all about permissions.

The solution for this problem has 2 parts:
1. Apache should run as aa windows service with checking allow service to interact with desktop in the properties.
2. I found that there is no way to access windows COM objects to read excel in normal way. So, instead we should use xlsread in basic mode.

That's all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM