The PHP code would only run on the server. PHP does have a printer extension for windows that you could use to send print jobs. Similar could be done on linux by using exec calls to the proper commands.

As far reading barcode scanners, that would be something you'd have to handle on the local client through some other language. I've no experience with such devices so I can't say much more than that.

Basically you can use PHP to do non-web things, but you have to keep in mind the client-server relationship and realize that your PHP code running on the server won't have access to things on the client PC such as scanners or the PC's files.

If you don't want it to be available from the internet, then you could just set up a web-server environment on the Point of Sales (POS) computer. Or have it run on a server, and then use a local PHP-CLI component to deal with the bar scanner. It is even possible to write a GUI application with PHP, but that's more of an afterthought and thus not really recommended.

Unfortunately things such as bar scanners aren't really designed to be used in a client-server application environment, which means you'll have to take a lot more care to ensure that the communication between the client and server parts goes smoothly. Since you already would need a local client to deal with the input from the bar scanner, I'd recommend writing the entire sales interface as a local client. You can still have it communicate with the server, upon closing the sale, fetching the inventory list and stuff like that.

In short: I'd recommend using a different language for the sales and bar scanner interface, one that's geared towards GUI applications. Preferably one that has an API for the bar scanner available.

We use barcode scanners with the applications I work on with at work. They communicate to PHP on the server without issue, client side, the data is handled by Javascript. From there, its just simple Ajax calls.

In regards to printing. Most of our printing is done via PDF's. We have a Java applet that handles the client side of things, but a lot of this could potentially be done via the native browser print dialogs.