PHP as CLI?

software development

#1

Okay, so I know you can run PHP as a command line interface… and I know you can on dreamhost. But if I want to use something like the phpinfo function in a PHP script, just for example’s sake, it comes out all HTML-y. Is there any way I can fix that? Using PHP 5 in case that matters.


#2

According to the php manual:

phpinfo() outputs plain text instead of HTML when using the CLI mode.

Have you experienced this problem, or do you just think you will if you try it?


#3

Normally it does, Herods, but I tested it and quite interestingly it’s not doing so. At least not on my compiled version or DH’s version. It works on the version I have at home, but that wasn’t compiled by myself.

I’ll have to investigate further to see what the difference is. Just hadn’t had time recently to check.


#4

Dreamhost PHP doesn’t run as CLI, then. Because when I try, I get HTML up the hoop.