0

I'm trying to send a codebar to a thermal printer via shell_excec(), the variable 'a' contains the route of the desired code and the code name itself. I'm working on localhost. My problem is that this chunk of code is properly executed in GNU/Linux (Trisquel) but when I switch to OsX it won't work

My first guess was that the file didn't had the proper permissions, but already checked and that's not the problem.

<?php
$cod =$_POST["a"];
$salida = shell_exec('lpr '.$cod);
echo $salida.' lpr '.$cod;
?>
Uriel Coria
  • 92
  • 1
  • 8

1 Answers1

0

Try add 2>&1 to end of you comand to exec:

shell_exec('lpr '.$cod.' 2>&1');

It may help tp you get more data from output produced by lpr

  • Thanks Pavel, I got this output dyld: Symbol not found: _iconv Referenced from: /usr/lib/libcups.2.dylib Expected in: /Applications/XAMPP/xamppfiles/lib/libiconv.2.dylib in /usr/lib/libcups.2.dylib – Uriel Coria Feb 13 '14 at 18:59
  • Looks like as some misconfig in libraries used. I'm not use MacOS to tell more. This may help: https://code.google.com/p/git-osx-installer/issues/detail?id=18 also, may suggest to try to use some other console program to do same what you want – Павел Осипов Feb 13 '14 at 21:18
  • I've tried it, it won't even let me through the ./configure statement to make && install. – Uriel Coria Feb 14 '14 at 17:13