1

I have a Windows XP Pro server running Apache 2.2, which is configured with an Alias /p that points to a UNC network path (//server/projects). Apache runs under the user Apache, which (as part of some previous troubleshooting) is a member of the Administrators group. I happen to have written up a blog post here that details the setup if you want more detail.

This Apache server runs a PHP application that, among other things, needs to access the server's serial ports (if you must know, it's a POS application, and yes I'm fully aware that a web app is not the ideal approach here -- wasn't my call). This works just fine from PHP scripts running off of the C drive, but scripts that live on the network server do not appear to have access to the server's hardware.

Accessing the serial ports is done like so:

<?php
$fh = fopen('com3', 'w+');
fwrite($fh, $data_to_send);

Again, works just fine for files that live on the C drive, but identical files on the UNC path don't work.

I need to find a solution that will allow these PHP scripts the same access to the hardware whether they're on the C drive or pulled from a network share.

Additional information:

  • This is a VM in VirtualBox; the network share is in fact a VirtualBox Shared Folder, which is implemented as a SMB network share. Full read/write access, and works for everything except this one thing.
  • Security of the server isn't a concern -- this is a dev/testing setup that is behind 3 distinct firewalls and NAT layers (a private LAN within a private LAN within a private LAN) with absolutely no access to it through any of them.
  • PHP is configured as CGI rather than an Apache module (not something I can change, since this is how this app is deployed); nonetheless, it does run under the Apache user as well.
4
  • 1
    "but scripts that live on the network server do not appear to have access to the server's hardware." <-- any specific errors that lead you to believe this?
    – EEAA
    May 10, 2012 at 20:42
  • @ErikA I don't get any specific errors, no, just that identical scripts on the C drive can talk to my serial ports, but on the network share they cannot.
    – Kromey
    May 10, 2012 at 21:04
  • It seems that this whole thing would solve itself if you stopped fighting and just used linux for this.
    – EEAA
    May 10, 2012 at 21:18
  • I'd love to, but my company develops a Windows application -- not my call.
    – Kromey
    May 10, 2012 at 22:37

0

You must log in to answer this question.

Browse other questions tagged .