I have built an API framework that includes a lot of communication-related options, including input validations and encryptions.
I figured that building an ‘API Wrapper’ class would be required because of all those options, to simplify the process when another system wants to connect to my API. So they can basically download a single class and very easily connect to my system through that class from their system.
This wrapper class makes requests using cURL.
My system also includes a logger that tracks API calls for future reference and investigation (if problems appear as well as performance grading), including tracking user agent string for all of those requests.
My question is, how good or bad is it if I include Apache and PHP version numbers in that string alongside with the API wrapper class version, like this:
myApi/1.0 (Apache 2.2.17;PHP 5.4.0)
I am worried if it is a problem if PHP version number is transmitted over the web in such a way, even though it’s between servers and not between client computer and server?
I think you might be crossing up the distinction between API and client. To paraphrase your question, it sounds like you’ve built:
an API with various services/resources
a client class (the “wrapper”) that a third-party developer can use in her own application to communicate with your API
If that’s the case, then the server information you’re looking to convey is the system requirements for an application that will use your client class. That has no relationship to the version of PHP that your API runs on, except that you happened to develop both API and client on the same platform. For example, if you had built the API in PHP and the wrapper in Java, then it would be easier to see the distinction.
The minimum PHP version for the client/wrapper class is important information to convey to third-party developers, so that they can use the class as you intend. In that case, then yes, you should provide it somewhere (my suggestion would be in the documentation for the wrapper class).