Environmental Considerations

Have you ever felt the need to grab your computer and give it a good shake, to wake it up and make it do what you want? This chapter gives you the tools to reach beyond Web pages, bypass your Web server, delve into your computer's internals, and perform surgery on the really obstinate parts of your system. You can add security at a finer level than offered by your Web server. You can give primitive command-line programs a civilized user interface by running the programs within a PHP script so users see a clean, helpful, and readable Web page.

This chapter contains the following sections:

In Depth
  Apache
  PHP Configuration
      Extensions
      php.ini Settings
      Time Limit
      Environmental Variables
  Security
      HTTP Authentication
      CHMOD
  PHP in Batch Mode
  Scheduling PHP
  COM
  File and Directory Names
      Linux and Unix
      Windows NT
      Macintosh
  POSIX
  Helping Programs Talk with Each Other
      Shared Memory
      Semaphore
  External Programs
  Extra Information
  mnoGoSearch FunctionsmnoGoSearch Functions
Immediate Solutions
  Cleaning Out Old Files
  Executing an External Program
  Converting Word Documents to RTF Using COM
  HTTP Authentication Example
  Modifying Code to Suit the Environment
      Error Logging
      User Aborts
      Script Timeouts
      Choice of Database
      Browser-Based Code
      Checking Functions
      Checking before Sending headers
      Checking PHP
  Testing Memory
  Outputting Unusual Formats
  Securing Images