PHP shell_exec in windows not writing to LPT1 -



PHP shell_exec in windows not writing to LPT1 -

i'm porting little piece of code wrote linux windows, need force zpl code zebra printer connected via usb. no problems shell_exec , lp in linux.

on windows, mapped usb printer lpt1, , no problems here, , if echo code (or re-create file) lpt1 (in cmd), works. like:

copy c:\zplcode.txt lpt1 *or* echo "zplcode here" > lpt1

my stuff gets printed.

now, said works flawless in cmd, if shell_exec this, doesn't work. thought shell_exec did not work @ all, does. in fact, echo shell_exec('ver')returns windows version. , copy c:\zplcode.txt lpt1 returns "1 file copied" in cmd, echo shell_exec('copy c:\zplcode.txt lpt1') returns "0 files copied". happens if seek copying normal file or echoing them.

it's apache doesn't have write permissions or something, still it's not on linux has own user, it's service running system... can help? thanks

edit2: solved problem disabling uac , forcing apache service run administrator, doing shell_exec("echo zplcode here > ///localhost//printer") printer name assigned printer when sharing it. guess problem still exists, since couldn't force info lpt1 if needed (unless sharing , doing did here).

you "mapped usb printer lpt1" ; such mappings local user's logon session (or perhaps remote desktop session, i'm not certain).

either way service won't see it, if configured run under same user account. each service gets separate logon session, , of windows vista, only services run in remote desktop session 0.

php windows apache permissions shell-exec

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -