PHP Checking privatekeys
You should not store your private keys on a webserver, unless you actually need to spend the bitcoins from that very same server.

Remember, to receive money on an address, check its balance, etc, you only need the address. This is much safer because that way nobody could steal your money, even if they get full access to your server.

One way to do it is to import all private keys in a new, separate wallet (default Bitcoin Core install would do), password-protect the wallet with a long, random, gibberish password and then discard the password (of course make sure you also still have the private keys in the original wallet). This essentially creates a "read only" wallet, which would be safe to put on your webserver, and allows for all functionality on your addresses, except spending the money. 

To actually spend the money, you use the original wallet that doesn't need to be on your webserver.