0

I'm trying to get access a local web server via web browser and give it an image, then the web server gives a processed image back.

I'm using ubuntu 14.04 using opencv 3.0.0, apache2 and php5.

This is the best example I could find thus far for what I am attempting to accomplish.

http://opencv-code.com/projects/web-based-interface-for-face-detection-with-opencv/

However, it simply hangs at a half loaded bar and never finishes the task. I re-read the instructions and found I had followed them to the letter and I still could not get it to work. Is this because I am using Ubuntu and not windows?

I'm open to using other methods for developing the front end to interface with the back end (opencv executables). However, I am very new to web development and I'm uncertain where to start (I've only made desktop applications up to this point).

If there is an easier way to do this please let me know.

Zypps987
  • 404
  • 6
  • 21
  • Have you tried looking at the PHP logs (and adding print statements when a request comes in and when you send work to the c++ program)? The Apache / webserver logs? Maybe your c++ program is hung? There are many possibilities with only the information that you've provided. – Dan Oct 25 '15 at 04:04
  • I didn't know about PHP logs! Thanks for the tip! Ok looking it over I found this to be the problem [Sun Oct 25 05:46:20.529988 2015] [:error] [pid 3236] [client 192.168.1.134:47079] PHP Fatal error: Call-time pass-by-reference has been removed in /var/www/html/web-based-face-detect-master/face-detect/face-detect.php on line 8, referer: http://192.168.1.114/web-based-face-detect-master/ Line 8 is $last = exec($cmd, &$out); However, I am not sure why this is wrong... – Zypps987 Oct 25 '15 at 05:49
  • Ok I think I may have found the problem.... it would appear to be the line above it $cmd = 'face-detect --input="'.$file.'" --outdir="'.dirname($file).'"'; Correct me if I'm wrong.... but isn't that command formated for windows cmd not linux terminal? – Zypps987 Oct 25 '15 at 06:04
  • Is [this](http://stackoverflow.com/q/12322811/387099) somehow related? – Utkarsh Sinha Oct 25 '15 at 18:55

1 Answers1

1

Debugging complicated code while it is running under Apache can be tricky, because browsers don't always tell you what is getting transmitted. Have you tried running your php page as a stand-alone app using the php command? That can be easier, as if the program gets a segmentation fault, you get the message to your console.

Kev Bo
  • 172
  • 1
  • 6