Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69528

PHP 7.2 and 7.3 WinCache Build Questions

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 3.9.1
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:
      None
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      We are running Moodle 3.5.13 on PHP 7.2.32 and preparing for Moodle 3.9.x on PHP 7.3.21, and have the idea to run WinCache since we're hosted on IIS 10.  First, is WinCache beneficial for this environment or already covered by OpCache?

      If it is beneficial, we are required to build WinCache from source in order to prove that we're using a scanned and vetted version of the source code and not just a DLL from the Internet.  To that end I've successfully used the following procedures to build it for PHP 7.2:

      1. Install MS Visual Studio 2017 with C++ desktop development workload
      2. Start x64 Native Tools Command Prompt for VS 2017 and run:
        md \Moodle
        cd \Moodle
        git clone https://github.com/Microsoft/php-sdk-binary-tools.git PHP-SDK
        cd PHP-SDK
        bin\phpsdk_buildtree phpdev
        cd phpdev\vc15\x64
        git clone https://github.com/php/php-src.git php-src
        cd php-src
        git checkout PHP-7.2.32
      3. Browse to https://github.com/php/pecl-caching-wincache/tree/WinCache_PHP7
      4. Click the Code button and Download ZIP
      5. Extract the downloaded ZIP to C:\Moodle\PHP-SDK\phpdev\vc15\x64\php-src\ext
      6. In the ext folder above, rename the extracted pecl-caching-wincache-WinCache_PHP7 folder to wincache
      7. Close Windows Explorer
      8. Back in previously minimized Command Prompt, run:
        \Moodle\PHP-SDK\phpsdk-vc15-x64
      9. At $ prompt type exit and Enter
      10. Run:
        set PHP_SDK_ARCH=x64
        set PHP_SDK_VS=vc15
        \Moodle\PHP-SDK\bin\phpsdk_deps -u
        buildconf
        configure --disable-all --disable-zts --enable-cli --enable-session --enable-wincache
        nmake
        x64\Release\php -v
      11. Result should be PHP 7.2.version (cli) (built: in the last few minutes) ( NTS MSVC15 (Visual C++ 2017) x64 )
      12. php_wincache.dll can be found in C:\Moodle\PHP-SDK\phpdev\vc15\x64\php-src\x64\Release

      However when I continue on to run these for PHP 7.3:

      git restore *
      git checkout PHP-7.3.21
      \Moodle\PHP-SDK\bin\phpsdk_deps -u
      buildconf
      configure --disable-all --disable-zts --enable-cli --enable-session --enable-wincache
      nmake

      I get (nmake | find /i "error"):

      Microsoft (R) Program Maintenance Utility Version 14.16.27043.0
      Copyright (C) Microsoft Corporation. All rights reserved.

      php_wincache.obj : error LNK2019: unresolved external symbol _imp_zend_hash_str_add@@32 referenced in function wincache_intercept_functions_shutdown
      php_wincache.obj : error LNK2019: unresolved external symbol _imp_array_init referenced in function wincache_intercept_functions_shutdown
      wincache_fcnotify.obj : error LNK2019: unresolved external symbol _imp_zend_hash_index_update@@24 referenced in function process_alive_check
      wincache_session.obj : error LNK2001: unresolved external symbol _imp_zend_hash_index_update@@24
      wincache_zvcache.obj : error LNK2001: unresolved external symbol _imp_zend_hash_index_update@@24
      wincache_zvcache.obj : error LNK2019: unresolved external symbol _imp_zval_ptr_dtor referenced in function copyout_hashtable
      C:\Moodle\PHP-SDK\phpdev\vc15\x64\php-src\x64\Release\php_wincache.dll : fatal error LNK1120: 4 unresolved externals
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe"' : return code '0x460'
      Stop.

      Does anyone have any suggestions on fixing it?  WinCache's GitHub site states "through 7.2" but then there are download packages available for 7.3, so someone must be able to do it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mhenry79 Mike Henry
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: