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

Open Source Technologies



                   Notes         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’ll 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.
                                 5.4 Testing Installation


                                 Installing PHP on your development PC allows you to safely create and test a web application
                                 without affecting the data or systems on your live website. This article describes PHP installation
                                 as a module within the Windows version of Apache 2.2. Mac and Linux users will probably
                                 have it installed already.
                                 All-in-One packages

                                 There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and
                                 other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer
                                 and Web Developer. There is nothing wrong with using these packages, although manually
                                 installing Apache and PHP will help you learn more about the system and its configuration options.

                                 The PHP Installer

                                 Although an installer is available from php.net, I would recommend the manual installation if
                                 you already have a web server configured and running.

                                 Manual Installation
                                 Manual installation offers several benefits:

                                    •  backing up, reinstalling, or moving the web server can be achieved in seconds and
                                    •  you have more control over PHP and Apache configuration.

                                 Step 1: extract the files
                                 We will install the PHP files to C:\php, so create that folder and extract the contents of the ZIP
                                 file into it.
                                 PHP can be installed anywhere on your system, but you will need to change the paths referenced
                                 in the following steps.
                                 Step 2: configure php.ini
                                 Copy C:\php\php.ini-recommended to C:\php\php.ini. There are several lines you will need
                                 to change in a text editor (use search to find the current setting).
                                 Define the extension directory:

                                                extension_dir = ”C:\php\ext”
                                 Enable extensions. This will depend on the libraries you want to use, but the following extensions
                                 should be suitable for the majority of applications (remove the semi-colon comment):

                                    1.  extension=php_curl.dll
                                    2.  extension=php_gd2.dll


        64                                LOVELY PROFESSIONAL UNIVERSITY
   64   65   66   67   68   69   70   71   72   73   74