Main Content

PHP Standalone - keyboard to screen

Archive - Originally posted on "The Horse's Mouth" - 2007-07-18 17:37:56 - Graham Ellis

PHP is a web language. Yes. And No. You can use it "standalone" too, and we often do so; to develop a whole lot of functions for web use in PHP, then duplicates in some other language, would be frankly silly after all.

And so it is that during the current course, I've been running rather more demos from the command line than I usually would - it suits the group, and works well. And I've made an interesting discovery - that the phpinfo function reformats its output well for the command line. Let me show you ...

grahamellis$ php
<?php phpinfo() ?>
phpinfo()
PHP Version => 4.3.10
System => Darwin earth-wind-and-fire.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh
etc
PHP Core
Directive => Local Value => Master Value
allow_call_time_pass_reference => On => On
allow_url_fopen => On => On
always_populate_raw_post_data => Off => Off
etc
PHP Variables
PHP_SELF => -
_SERVER["MANPATH"] => /sw/share/man:/usr/share/man
_SERVER["TERM_PROGRAM"] => Apple_Terminal
_SERVER["TERM"] => xterm-color
_SERVER["SHELL"] => /bin/bash
_SERVER["PERL5LIB"] => /sw/lib/perl5:/sw/lib/perl5
_SERVER["TERM_PROGRAM_VERSION"] => 100.1.6
_SERVER["USER"] => grahamellis


I never cease to be impressed with PHP ...