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.
- 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.