Page 15 - Open Soource Technologies 304.indd
P. 15

Unit 1: Introduction to PHP



            Now, on to the interesting part: Below is a suggested file layout for your new PEAR installation.  Notes
            To change individual locations, type the number in front of the directory. Type ‘all’ to change all
            of them, or simply press Enter to accept these locations.
               1.  Installation prefix: /usr/local
               2.  Binaries directory: $prefix/bin
               3.  PHP code directory: $prefix/share/pear
               4.  Documentation base directory: $php_dir/docs
               5.  Data base directory: $php_dir/data
               6.  Tests base directory: $php_dir/tests

            Each setting is internally assigned to a variable (prefix, bin_dir, php_dir, doc_dir, data_dir and
            test_dir, respectively). You may refer to the value of other settings by referencing these variables,
            as shown previously. Let’s take a look at each setting:
            Installation prefix: The root directory of your PEAR installation. It has no other effect than serving
            as a root for the next five settings, using $prefix.

            Binaries directory: Where programs and PHP scripts from PEAR packages are installed. The pear
            executable ends up here. Remember to add this directory to your PATH.
            PHP code directory: Where PHP code is installed, this directory must be in your include_path
            when using the packages you install.
            Documentation base directory: This is the base directory for documentation. By default, it is $php_
            dir/doc, and the documentation files for each package are installed as $doc_dir/Package/file.
            Database directory: Where the PEAR Installer stores data files. Data files are just a catch-all category
            for anything that does not fit as PHP code, documentation, and so on. As with the documentation
            base directory, the package name is added to the path, so the data file convert.xsl in MyPackage
            would be installed as $data_dir/MyPackage/convert.xsl.

            Tests base directory: Where regression test scripts for the package are installed. The package name
            is also added to the directory. When you are satisfied with the directory layout, press Enter to
            proceed: The following PEAR packages are bundled with PHP: DB, Net_Socket.
            After you have compiled or installed PHP, you can still change its behavior with the php.ini file. On
            Linux/Unix systems, the default location for this file is/usr/local/php/lib, or the lib subdirectory
            of the PHP installation location you used at configuration time. On a Windows system, this file
            should be in the Windows directory.
            Directives in the php.ini file come in two forms: values and flags. Value directives take the form
            of a directive name and a value separated by an equal sign. Possible values vary from directive
            to directive. Flag directives take the form of a directive name and a positive or negative term
            separated by an equal sign. Positive terms include 1, On, Yes, and True. Negative terms include
            0, Off, No, and False. Whitespace is ignored.

            You can change your php.ini settings at any time, but after you do, you will need to restart the
            server for the changes to take effect. At some point, take time to read through the php.ini file on
            your own to see the types of things that can be configured.

                          PHP is running more than 20 million websites and 1 million web servers in
                          the world till 2011.







                                             LOVELY PROFESSIONAL UNIVERSITY                                     9
   10   11   12   13   14   15   16   17   18   19   20