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

Web Technologies-I



                   Notes         1.3.7 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. In this we describe 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, the manual installation if you already have a web
                                 server configured and running.
                                 1.3.8 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
                                    3.  extension=php_mbstring.dll
                                    4.  extension=php_mysql.dll
                                    5.  extension=php_mysqli.dll
                                    6.  extension=php_pdo.dll
                                    7.  extension=php_pdo_mysql.dll
                                    8.  extension=php_xmlrpc.dll

                                                If you want to send emails using the PHP mail () function, enter the details of
                                                an SMTP server (your ISP’s server should be suitable):



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