You are creating an application that sends data or shall we say prints data to a shared printer over the network. On an regular setup, Apache runs as a service by the System User which does not have network access. When you tried to access network resources like shared printers, it does not allow you to add print job because of lack of privileges.
Run Apache as Local User
When you install Apache 2.2 in Windows XP, it will install as a service by default, using the System User account. The System User account has many privileges such as read/write access to files on all folders, however, it does not have network access.
You can actually find the steps here: http://httpd.apache.org/docs/2.2/platform/windows.html#winsvc
But to explain in on more simple terms, here we go:
1. Create an ordinary user account, ex: wwwuser. Make sure it is a member of Users group. Don’t make it a member of Administrator or any high privilege groups.
2. Add privilege Log on as a service and Act as part of the operating system by going to Control Panel -> Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment. Look for Log on as a service and Act as part of the operating system entries from the list, open it and add the newly created user into it, ex: wwwuser.
3. Grant Read and Execute (RX) to the whole Apache2.2 directory to this user, ex: wwwuser.
4. Grant Read, Write, Change and Execute (RWXD) to Apache log directory.
5. Stop apache: go to Control Panel -> Administrative Tools -> Services. Look for Apache and stop the service.
6. Right-click Apache on the list -> click Properties. Go to Logon tab, then configure the account for Apache to run. Be sure to enter the correct username and password.
7. Start Apache. Be sure that you grant Read/Write/Change access to folders that your PHP application is using to write files such as Cache directory and the like.