I created a basic web server in Java. It can also run php code.
I execute:
php - f <file>
to get the result and send it back to the client. It works great, however when I want to use the phpinfo(); function, it returns plain text as it is written in the manual too. How can I get the result in HTML format like Apache does?
Thank you!
phpinfo()doesn't output HTML if in CLI (Command Line Interface) mode, and CLI mode is enabled automatically if running from the command line (or the equivalent that you are doing). Maybe execute with the option--disable-cli.