IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Upgrade to PHP 7.2 on IIS (Windows 10)

This tutorial is a shorter version of the previous post upgrading to PHP 7.1 on Windows 10 and it is intended as a follow-up on how to upgrade your PHP to the latest version (in this case PHP 7.2) if you have already installed the previous version of PHP 7 in your Windows system.

Steps to Upgrade from PHP 7.1 to PHP 7.2

  1. Download PHP for Windows. Since we’re using PHP as FastCGI, we’ll use the 64-bit Non-Thread Safe (NTS) version (i.e., php-7.2.1-nts-Win32-VC15-x64.zip).

  2. PHP 7.2 is also the first version that requires Visual C++ Redistributable for Visual Studio 2017. If you don’t have it installed, you can download it from here (64-bit). If you have a 32-bit OS, please check on the download section below and select the one for x86.

  3. We also need to upgrade our WinCache version for PHP 7.2. Download the WinCache php_wincache-2.0.0.8-7.2-nts-vc15-x64 and extract the file as well.

    WinCache Binary for PHP 7.2

  4. Extract both downloaded zip files (just double-click them and they will be extracted into their sub-folders) as shown below:

    PHP 7.2 and WinCache zip files extracted to sub-folders

  5. If you check the WinCache folder php_wincache-2.0.0.8-7.2-nts-vc15-x64, look for two files with the following names: php_wincache.dll and php_wincache.pdb.

  6. Copy the two files from the WinCache folder to a sub-folder (“ext”) within the PHP folder (i.e., php-7.2.1-nts-Win32-VC15-x64/ext).

    Copy php_wincache files from WinCache folder to ext sub-folder under PHP folder

  7. Now, copy the whole content of php_wincache-2.0.0.8-7.2-nts-vc15-x64 folder into a new folder and name it v7.2.

    Copy all PHP files to a new folder v7.2

  8. Copy the php.ini file from v7.1 to v7.2.

  9. You might want to modify certain parameters in the php.ini as highlighted below:

    [WebPIChanges]
    error_log=C:\WINDOWS\temp\PHP72x64_errors.log
    upload_tmp_dir=C:\WINDOWS\temp
    session.save_path=C:\WINDOWS\temp
    cgi.force_redirect=0
    cgi.fix_pathinfo=1
    fastcgi.impersonate=1
    fastcgi.logging=0
    max_execution_time=300
    date.timezone=Australia/Melbourne
    extension_dir="C:\Program Files\PHP\v7.2\ext\"
    

    And make sure you also have the PHP_WINCACHE set.

    [PHP_WINCACHE]
    extension=php_wincache.dll
    

    The change is pretty simple and we can compare the two php.ini files between v7.1 and v7.2 as below:

    Compare php.ini files between v7.1 and v7.2

  10. Open IIS Manager and click on FastCGI Settings.

    IIS Manager FastCGI Settings

  11. You can create a new entry for PHP 7.2 by following Step 8 from previous post, except for PHPRC where you want to update the value to 7.2 (i.e., C:\Program Files\PHP\v7.2).

    Once completed, just click OK.

    IIS Manager FastCGI Settings Modify PHPRC to version 7.2

  12. Go back to IIS Manager and click on Handler Mappings.

    IIS Manager Handler Mappings

  13. Look for PHP_via_FastCGI and double-click on it. Make sure the path for the Executable is updated accordingly. Click OK when done.

    IIS Manager Handler Mappings PHP_via_FastCGI set to v7.2

Update Windows Environment Variables

Finally, once again we need to update the path of the new PHP in Windows Environment Variables.

  1. Click on the Windows start button and type in “system” and click on System Control panel.

    Windows System Control Panel

  2. In System window, click on Advanced system settings and on System Properties window, make sure you have Advanced tab opened. And you can follow the path shown in the picture to update the path to where your PHP 7.2 is located.

    Control Panel System Environment Variables Update to PHP 7.2

  3. Click on Environment Variables… button.

  4. Under System Variables, click on Path and Edit… button.

  5. Click on where the current PHP is located and double-click it or click on Edit button.

  6. Change the value to the location of the new PHP (i.e., C:\Program Files\PHP\v7.2)

  7. Click OK button on each window to close.

That’s it! Now using the same test.php file with the following code:

<?php phpinfo(); ?>

Run it from your browser (i.e., http://localhost/test.php). If PHP is installed with the correct version, you will see the PHP version will be updated similar to the picture below:

phpinfo 7.2.1 displayed on a page

Further Reading

How to Install PHP on Windows 10 Using Web Platform Installer
FastCGI
Difference between PHP thread safe and non thread safe binaries
Using FastCGI to Host PHP Applications on IIS 7
WinCache Extension for PHP

Download

Download PHP For Windows: Binaries and sources Releases
WinCache 2.0.0.8 PHP Extension Direct Download
Microsoft Visual C++ Redistributable for Visual Studio 2017

January 19, 2018 Filed Under: How To Tagged With: IIS, Internet Information Services, Microsoft, PHP, Windows, Windows 10

How to Reassign Column Selection Shortcut Keys in Sublime Text

Following the previous post on assigning a new keyboard shortcuts for column selection, this time we’re going to the same thing in Sublime Text.

As always, before you make any changes, make sure you backup everything.

macOS (OSX)

On the top menu, click on Sublime Text -> Preferences -> Key Bindings and a split screen will open.

Sublime Text Preferences Key Bindings

Sublime Text User Keymap

Using the same key combination as in the example provided for Visual Studio Code (SHIFT-ALT-ARROW), you can paste the following javascript code on the right pane (User). If you’ve already had other custom keybindings, you want to add the two lines without the square brackets in the beginning and end of the code block.

Default (OSX).Sublime-keymap — User

[
    { "keys": ["shift+alt+up"], "command": "select_lines", "args": {"forward": false} },
    { "keys": ["shift+alt+down"], "command": "select_lines", "args": {"forward": true} },
]

Windows

On Windows version of Sublime Text, you can click directly on Preferences -> Key Bindings from the top menu and apply the same treatment as above (copy and paste the JSON above to the right-pane of the split screen).

Sublime Text Preferences Key Bindings on Windows

Closing Thought

Personally, custom key binding especially for column selection has helped me to use both Visual Studio Code and Sublime Text without requiring me to make too much mental switch on either Windows or Mac.

Another trick you may want to try is to use a similar key placement instead of the literal key combination instead. What I mean by this is that the position of ALT key in Windows and Mac is a bit different. The ALT key on Windows is on the same position as Command (⌘) key on Mac.

So I set my Mac column selection key binding a bit different than its Windows counterpart (alt is replaced with command instead).

[
    { "keys": ["shift+command+up"], "command": "select_lines", "args": {"forward": false} },
    { "keys": ["shift+command+down"], "command": "select_lines", "args": {"forward": true} },
]

Related Article

How to Reassign Shortcut Key for Column Selection in Visual Studio Code
How to Add Comma to Each Line Using Visual Studio Code or Sublime Text

August 12, 2017 Filed Under: How To Tagged With: Code Editor, Sublime Text

How to Reassign Shortcut Key for Column Selection in Visual Studio Code

If you use column selection often in Visual Studio Code, you may find the default shortcut keys combination is a bit too much. By default, to make a column selection or multiple lines in the same horizontal cursor position, you need to press CTRL-SHIFT-ALT and either UP or DOWN arrow depending on the direction of your selections.

Fortunately, you can always assign your own shortcut keys for virtually any functions in this powerful code editor.

So here are the steps to do so.

  1. From the top menu, select File -> Preferences -> Keyboard Shortcuts (or press a combination of CTRL-K CTRL-S) to open the Keyboard Shortcuts windows.

    Visual Studio Code Preferences

  2. Within Keyboard Shorcuts window, look for the following:

     
    cursorColumnSelectDown
    cursorColumnSelectUp
    cursorColumnSelectPageDown
    cursorColumnSelectPageUp
    
  3. Right-click and select Change Keybinding (CTRL-K CTRL-K) and press the key combination you want to use and press ENTER to save it or ESCAPE to cancel. In this example, I use a keyboard combination SHIFT-ALT-ARROW. Repeat this step for each operation.

  4. Once completed, you should see something similar to the screenshot below in your Keyboard Shortcuts window.

    Visual Studio Code Keyboard Shortcuts

That’s it.

If you want to see the configuration in JSON format, you can click on the active link keybindings.json on the top of the Keyboard Shortcuts window (For advanced customizations open and edit keybindings.json), then you’ll see the JavaScript Object Notation that looks similar to the following:

// Place your key bindings in this file to overwrite the defaults
[
    {
        "key": "shift+alt+down",
        "command": "cursorColumnSelectDown",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+down",
        "command": "-cursorColumnSelectDown",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+up",
        "command": "cursorColumnSelectUp",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+up",
        "command": "-cursorColumnSelectUp",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+pagedown",
        "command": "cursorColumnSelectPageDown",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+pagedown",
        "command": "-cursorColumnSelectPageDown",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+pageup",
        "command": "cursorColumnSelectPageUp",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+pageup",
        "command": "-cursorColumnSelectPageUp",
        "when": "editorTextFocus"
    }
]

As indicated on the top banner of Keyboard Shortcuts window, as an advanced user, can always go straight to the keybindings.json and modify the keyboard shortcuts in the json file directly.

Related Articles

How to Make Visual Studio Code Colorize Classic ASP Code
How to Reassign Column Selection Shortcut Keys in Sublime Text
How to Open Visual Studio Code from command line macOS
How to Add Comma to Each Line Using Visual Studio Code or Sublime Text

Further Reading

Key Bindings for Visual Studio Code

Download

Visual Studio Code

August 10, 2017 Filed Under: How To Tagged With: Code Editor, Microsoft, Visual Studio Code

How to Troubleshoot Response Buffer Limit Exceeded Error in Classic ASP

How do you troubleshoot a classic ASP website when it crashes with the following error message?

Response object error 'ASP 0251 : 80004005'
 
Response Buffer Limit Exceeded
 
/itnota/test.asp, line 0
 
Execution of the ASP page caused the Response Buffer to exceed its configured limit.

Turn Off Page Buffering

By default, page buffering in ASP is set to On so one way to do it is just to turn off the page buffering.

At the top of your ASP page, add the following line after the VBScript declaration (Line 2 – highlighted):

<% @Language="VBScript" %>
<% Response.Buffer = False %>

In general though, you do want to pose a limit so your data stream does not clog up your resources especially if you’re sharing the web server with other applications. That’s why the next solution would be a better one especially for production environment.

Modify Response Buffering Limit in IIS

Another way to solve this issue is explained below, demonstrated using IIS 10 but should work the same way with IIS 7 or later as well. This would be the best solution but you need access to your IIS.

  1. Launch your IIS Manager and select your site on the Connections box on the left. Then double-click on the ASP on the right pane, which is under IIS section.

    IIS Manager ASP Configuration Settings

  2. Once the ASP window is opened, look for Limit Properties and expand on it and go to Response Buffering Limit.

    If the value was never modified, you would see 4194304 which translates to roughly 4 MB.

    IIS Manager ASP Response Buffering Limit Property (default value)

  3. This is the value, we want to modify so go ahead and change it to a larger number. In this example, we put in 64000000 (~64 MB, not quite but you get the point), basically adjust according to your need.

    IIS Manager ASP Response Buffering Limit (click Apply)

  4. Once you entered the value, just click on the Apply link button to save all settings.

The effect should be immediate without requiring a restart of IIS or Application Pool. That’s all there is to it.

Further Reading

IIS 6.0: “Response buffer limit exceeded”
Response Buffer Limit Exceeded

July 18, 2017 Filed Under: How To Tagged With: Classic ASP, IIS, Internet Information Services, Windows Server

How to Use cURL HTTP/2 on macOS

cURL is one of most powerful tools for testing HTTP traffic. We typically use cURL to interact with HTTP APIs or test websites.

Although cURL supports HTTP/2, the version that’s installed on macOS Sierra does not. Read Update.

If you try to use the --http2 flag, you’ll receive the following error:

$ curl -I --http2 https://www.itnota.com
curl: (1) Unsupported protocol

Fortunately, we can use another installation from Homebrew alongside the default version. To do so, just type the following command in the Terminal window (assuming you already have Homebrew installed):

$ brew install curl —with-nghttp2

That’s it.

Keep in mind that this installation does not replace the default curl in the system and this can be a good or bad thing for you.

If you want to keep things separately, you’re done as you can always call the 2nd curl by typing its full path:

$ /usr/local/opt/curl/bin/curl -I --http2 https://www.itnota.com

If you check the version of the two in this example:

# Default Version
 $ curl --version
curl 7.51.0 (x86_64-apple-darwin16.0) libcurl/7.51.0 SecureTransport zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets 

# Homebrew Version
 $ /usr/local/opt/curl/bin/curl --version
curl 7.54.0 (x86_64-apple-darwin16.6.0) libcurl/7.54.0 OpenSSL/1.0.2l zlib/1.2.8 nghttp2/1.23.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy

If you want to set the curl you installed from Homebrew as the default, keep reading.

Set Homebrew cURL as the Default

There are several ways to set the new version as your default curl, but I believe the best and safest way to do it was already suggested at the end of installation process.

Notice that after installing the curl from Homebrew you’ll see a warning and instruction. If you missed it, it will look similar to this:

Homebrew cURL Installation Instructions

[...]

######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/curl/7.54.0 --with-==> make install==>
 Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/curl/lib
    CPPFLAGS: -I/usr/local/opt/curl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig

[...]

Just following the instruction provided, type in the following:

$ echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.bash_profile

You need to restart terminal and this time if you call curl without the full path, it will run the Homebrew version.

If you need to refer back to the default macOS version, just edit your ~/.bash_profile file by typing the following command:

$ sudo nano ~/.bash_profile

Look for this line:

export PATH="/usr/local/opt/curl/bin:$PATH"

and comment it out like so:

# export PATH="/usr/local/opt/curl/bin:$PATH"

And press CTRL-X and Yes to exit and save it.

Now you can test it using —http2 flag:

$ curl -I --http2 https://www.itnota.com

Update

Update on 5/21/2019: There are two updates that render this post obsolete.

First update is that the version of curl installed on macOS now supports HTTP/2.

The second update is that Homebrew has removed the –with-nghttp2 option from curl which makes the instructions not accurate.

You can still follow the instructions above for Homebrew version of curl only if you substitute it with the curl-openssl and its corresponding path instead.

So you can uninstall Homebrew curl by running the following:

$ brew uninstall curl

Then install curl-openssl by running the following:

$ brew install curl-openssl

That’s it. You don’t even need to specify any flag such as --with-nghttp2 on the curl-openssl install. It will just work. You just need to pay attention to the path where the curl is installed. It is

/usr/local/opt/curl-openssl/bin/curl

The latest comparison between the two versions of curl:

# Default Version
 $ curl --version
curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy 

# Homebrew Version
 $ /usr/local/opt/curl-openssl/bin/curl --version
curl 7.65.0 (x86_64-apple-darwin18.6.0) libcurl/7.65.0 OpenSSL/1.0.2r zlib/1.2.11 brotli/1.0.7 c-ares/1.15.0 libssh2/1.8.2 nghttp2/1.38.0 librtmp/2.3
Release-Date: 2019-05-22
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets

Further Reading

brew install curl –with-nghttp2 errors saying “invalid option: –with-nghttp2”

June 10, 2017 Filed Under: How To Tagged With: Internet, macOS

« Previous Page
Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure