2012年6月20日 星期三

2. Install PHP 5.2.x/5.3.x with MySQL extentions

Which version do I choose?
=====================================================================

If you are using PHP with Apache 1 or Apache2 from apache.org you

need to use the VC6 versions of PHP

VC6 Versions are compiled with the legacy Visual Studio 6 compiler

If you are using PHP with IIS you should use the VC10 versions of PHP

VC10 Versions are compiled with the Visual Studio 2010 compiler and

have improvements in performance and stability. The VC10 versions

require you to have the Microsoft 2010 C++ runtime installed

*** Do NOT use VC10 version with offical apache.org binaries ***


Install PHP 5.2.x/5.3.x with MySQL extensions
=====================================================================

(v5.3.14-VC9 tested)

STEP1:  Apache must be installed first!

STEP2:  download and execute php-5.2.x-win32-installer.msi with

        default setting

        NOTE: if you had installed the Apache from ASF build,

              use php-5.2.x-Win32-VC6-x86.msi

              if you had installed the Apache from Apache Lounge build,

              use php-5.3.x-Win32-VC10-x86.msi



STEP3:  must be 'I accept the terms...'

STEP4:  when ask dest folder, recommend change to C:\PHP just for

        easy accessing

STEP5:  when ask in Web Server Setup, click 'Apache 2.2.x Module'

STEP6:  when ask Apache Configuration Directory, browser to your

        Apache folder installed, C:\Apache2 likes

STEP7:  in 'Choose Items to Install', open extensions tree, make sure

        the MySQL item was selected, click 'Next' button and install


To test if worked
---------------------------------------------------------------------

STEP8:  RESTART the httpd service through the Apache Monitor in task

        bar or run from [Apache folder]\bin\httpd.exe

STEP9:  cut below(w/o separate line) as a simple PHP file into

        [Apache folder]\htdocs\hello.php

         ---------------------------------------

         <html>
           <head>
             <title>PHP Test</title>
           </head>
           <body>
             <?php echo '<p>Hello World</p>'; ?>
           </body>
         </html>

         ---------------------------------------

STEP9:   open url http://127.0.0.1/hello.php in web browser to see if

         PHP work








FAQ
=====================================================================

After open url http://127.0.0.1/hello.php

Q1: parsing PHP.ini error

A: try re-install in C:\PHP with 'short' name folder

   it is PHP installer bug, in the later version has been fixed


---------------------------------------------------------------------
Q2: PHP.ini can't be loaded, the Apache fail to load MySQL extension

   for PHP module

   NOTE: later version apache 2.2.17 + php 5.2.14, apache 2.2.19 +

         php 5.3.6 has no above problem...

A: this occurred in apache 2.2.4 + php 5.2.2

   check the ..\Apache folder\conf\httpd.conf in the last lines if it

   appears

        #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
        PHPIniDir "C:\PHP\"
        LoadModule php5_module "C:\PHP\\php5apache2_2.dll"
        #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

    then this is strange error! the PHP folder text has a

    unnecessary '/'  end, you must modify the PHPIniDir

    without '\' end and also modify LoadModule php5_module setting

    to "C:\PHP\php5apache2_2.dll" although this line doesn't matter


---------------------------------------------------------------------
Q3: failed to find the libmysql.dll while httpd restarting

   NOTE: later version apache 2.2.17 + php 5.2.14, apache 2.2.19 +

   php 5.3.6 has no above problem...

A: this occurred in apache 2.2.4 + php 5.2.2

   check the Environment Variables of system, the PATH must has

   C:\PHP (or where PHP installed), it may need to restart system to

   let Apache get new PATH setting

   else you can just copy PHP/libmysql.dll to your Windows\system32

   folder, it need restart the httpd again

沒有留言:

張貼留言