Categories
Windows

To create a Wamp-like Web Server in Windows7-#2.

同一記事の日本語版
Update information      Edit(Dec.27)    Edit2(2014.Mar.24)

   Continued from my last post.

The installation of ActivePerl.

  1. Download ActivePerl-5.16.3.1603-MSWin32-x86-296746.msi.
  2. Install ActivePerl-5.16.3.1603-MSWin32-x86-296746.msi into Drive_SV (A partition for server wares I made) by the default.
  3. Run a cmd.exe
    >perl -v
    If you get the version information, the directory Perl is already added to the Path.
  4. Customize the printenv.pl file (Location:Apache24cgi-bin).
    #!D:/programs/perl/bin/perl.exe  —>  #!Drive_SV:/Perl/bin/perl.exe

    Move printenv.pl from Apache24cgi-bin to drive_DC:WEBcgi-bin.
    Access http://xxx.xxx.xxx.xxx/cgi-bin/printenv.pl from a web browser.

    If you have the server environment variables list, the installation is complete.

  5. Remove printenv.pl.
  6. (*) To use CGI scripts outside of ScriptAliased directories, you will need directive AddHandler: (You will also need to add “ExecCGI” to the “Options” directive.)

The installation of PHP5.5.

  1. Actually, on Jun 20th PHP5.5 was released, but, this doesn’t support WindowsXP anymore. So, until now, I wasn’t able to use it if I wanted to use it. Now, I have a Windows7 on Xw4200, so I downloaded php-5.5.1-Win32-VC11-x86.zip. This is a thread safe version because my web server software is Apache and OS is Windows. To confirm about this thing, please read the install.txt of PHP by yourself.
    Extract the Zip archive.
    Rename the directory php-5.5.1-Win32-VC11-x86 to PHP.
  2. Copy the file php.ini-production as the file php.ini. Customize the php.ini file (Location:PHP).
      Default Custom
    1 ;default_charset = “UTF-8” default_charset = “UTF-8”
    2 ; extension_dir = “ext” extension_dir = “Drive_SV:PHPext”
    3 allow_url_fopen = On allow_url_fopen = Off
    4 ;extension=php_curl.dll extension=php_curl.dll
    5 ;extension=php_gd2.dll extension=php_gd2.dll
    6 ;extension=php_mbstring.dll extension=php_mbstring.dll
    7 ;extension=php_mysql.dll extension=php_mysql.dll
    8 ;extension=php_mysqli.dll extension=php_mysqli.dll
    9 ;extension=php_openssl.dll extension=php_openssl.dll
    10 ;date.timezone = date.timezone =”Asia/Tokyo”
    11 ;sendmail_from = me@example.com sendmail_from = My email address
    12 ;mbstring.language = Japanese mbstring.language = Japanese
    13 ;mbstring.internal_encoding = UTF-8 mbstring.internal_encoding = UTF-8
    14 ;mbstring.http_input = UTF-8 mbstring.http_input = pass
    15 ;mbstring.http_output = pass mbstring.http_output = pass
    16 ;mbstring.encoding_translation = Off mbstring.encoding_translation = Off
    17 ;mbstring.detect_order = auto mbstring.detect_order = UTF-8,ASCII,SJIS,EUC-JP,JIS
    18 ;mbstring.substitute_character = none mbstring.substitute_character = none

    (*) About the 14-18, it should work by leaving the default. The above 14-18 customization is particularly for my server.

    Three additional settings by the security reason. The 19 and 21 settings might give some troubles on your server. It depends on your server environment. (Edit:Dec.27).

      Default Custom
    19 output_buffering = 4096 output_buffering = Off
    20 expose_php = On expose_php = Off
    21 mysql.allow_persistent = On mysql.allow_persistent = Off
  3. Move the directory PHP to Drive_SV.
  4. Make an extra conf file as php55.conf in Drive_SV:Apache24confextra.
    The text of php55.conf:
    LoadModule php5_module “Drive_SV:/PHP/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php
    PHPIniDir “Drive_SV:/PHP”

    Customize the httpd.conf (Location:Apache24conf).
    DirectoryIndex index.html  —>  DirectoryIndex index.php index.html
    Add the next two lines to at the end of the Supplemental configuration section:
    # PHP settings
    Include conf/extra/php55.conf

  5. Make a php file as test.php in drive_DC:WEBhtdocs
    The text of test.php:
    <?php phpinfo() ?>
  6. Restart Apache.

    Access http://xxx.xxx.xxx.xxx/test.php from a web browser.

    If you have the phpinfo list, the installation is complete.

  7. Remove test.php.
  8. Customize the php.ini (Location:PHP).
    ;disable_functions =  —>  disable_functions =”shell_exec, suexec, passthru, phpinfo”
  9. Restart Apache.

Edit2(2014.Mar.24):
   I enabled the Opcache on 2013 Dec. 27. If you use a lot of PHP scripts on your server, I also recommend the post “Enabled Opcache”.