Reputation: 157
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!
Upvotes: 0
Views: 257
Reputation: 2218
You might want to try running the file through the php-cgi interface instead (should be an executable named php-cgi or similar).. this is one of the ways you can run php under apache.. (other choice being mod php or fcgi)
Raidence, why would you make a http server with dependencies to apache, you dont get the redundancy in that?
Upvotes: 1
Reputation: 6844
I'm afraid that's hardcoded in PHP's binary. It detects if it's running an Apache module or the CLI binary. Since you're not invoking the Apache module, it uses the CLI one. From the manual page:
phpinfo() outputs plain text instead of HTML when using the CLI mode.
Upvotes: 5