-->

libxml to stdout when using fastcgi Library

2019-07-21 16:52发布

问题:

We are attempting to create an XML feed using libxml, the code to produce the output is working fine, a valid XML listing is produced, the only problem is that the output goes to the error log (by way of stderr) rather than the required web page (by way of stdout) when using the fastcgi library. The same thing occurs whether the code is run using a browser or curl.


Versions/releases:
Fedora: release 20
Apache: 2.4.10
fastcgi:? the latest
libxml: 2

No code has been included with this question as I don't think it will help, the problem is with the fastcgi library 'taking over' stdout and libxml not acknowledging this, rather than with the code itself.

If a listing really is considered necessary then it could be added but will add verbosity without aiding clarity.

In short the question is 'how can we use libxml with fastcgi on Linux/Apache?'

EDIT:Probably would have helped had I mentioned that we are developing in C.

EDIT:Might also help knowing that we have tried all the output methods suggested in this standard libxml example, substituting '-' for a 'real' file name, so stdout is used instead. This has not aided our cause, output needs to go to fastcgi's 'cgiOut' alternative but goes to stderr in all cases.

EDIT:As far as I can see it is only possible to pass libxml a file name, not a handle, for where output should be sent. If output should go to stdout, the file name '-' is used, unfortunately, as stated above, output then goes to the error log. If it was possible to pass libxml a file handle (when using fastcgi this would be cgiOut) rather than a name then I suspect the problem would be resolved, but I cannot see any way this can be done.