PHP 5 Power Programming

   »    Book by Andi Gutmans, Stig Sæther Bakken, and Derick Rethans

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Computer Books » PHP » PHP 5 Power Programming »

Exit Code
If the script fails, exit with a non-0 code (except 255,
which is reserved by PHP itself for compile/parse errors). If the script does not
fail, exit with code 0.
Be aware that earlier PHP versions (pre-4.2) had a bug in the exit code
handling. Exiting in any other way than letting the script finish results in a
“non-true” exit code. (more…)


• • •
 

Command-line options are used in UNIX to specify alternate behavior or addi-
tional parameters for commands. You spot them by the leading dash. Here are
some examples:
$ ls ­ltr
$ rm ­f junk
Usually, options are located before regular parameters (that do not start
with a dash) on the command line. Some commands, such as cvs or pear, have
additional subcommands accepting their own set of options. The PEAR
installer is one such command. (more…)


• • •
 

The CLI PHP script operates differently in its environment compared to its
web-server embedded counterpart. Shell scripts are running in their own pro-
cess, containing PHP and nothing else. Inside a web server, PHP shares the
process with the web server itself and any other modules the web server may
have loaded. The web server environment has many restrictions because of
this. For example, who gets standard input? What about signals, and what
happens if you fork (duplicate) the process? Usually all of these types of
resources are managed by the hosting web server. (more…)


• • •
 

On UNIX-like systems, PHP (with
back-ends other than CLI) looks for php.ini in /usr/local/lib by default. To be
more “shell-ish,” the CLI back-end looks for /etc/php-cli.ini by default, instead.
This makes it possible to keep separate php.ini files for your web server and
CLI/shell scripts, without having to specify the ­c option every time you run a
PHP-driven script. (more…)


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com