Upgrade to PHP 7.1

Document ID : KB000125183
Last Modified Date : 23/01/2019
Show Technical Document Details
Question:
I need to upgrade PHP to version 7.1 for CA Software Asset Manager 4.3.x. How do I do that?
Answer:
Upgrading CA SAM 4.3.x to PHP 7.1
 
IMPORTANT: Ensure you backup or snapshot your existing SAM environment BEFORE upgrading.
 
This section describes the steps required to upgrade PHP for an existing CA SAM installation. On 12/31/2019, PHP 7.0 will no longer be supported. Clients should to upgrade their existing PHP environment to version 7.1. As part of that process, CA SAM will also need to be upgraded to run with the updated version of PHP (using the appropriate installation package).
 
Step 1 – Check Installation, correct any errors or warnings before proceeding with the upgrade (Admin / Maintenance / Check installation). In some cases, you may need to rebuild the system tables (Admin / Maintenance / Rebuild system tables)
 
Step 2 – Verify no configurations are in the “Running” state. Go to Admin / Configuration / Browse configuration and search where Value = Running. If you see any, delete the configuration.
 
Step 3 – Download the SAM installation package from CA Download Center.
 
Step 4 – Create C:\TEMP directory
 
Step 5 – Create C:\TEMP\SAM directory
 
Step 6 – Extract the SAM install package to C:\TEMP\SAM
 
Step 7 – Rename existing SAM folders (adjust as necessary for your installation):
  • C:\Program Files (x86)\CA\SAM\app\htdoc\{tag} => C:\Program Files (x86)\CA\SAM\app\htdoc\{tag}_OLD
  • C:\Program Files (x86)\CA\SAM\app\includes\{tag}  => C:\Program Files (x86)\CA\SAM\app\includes\{tag}_OLD
  • C:\Program Files (x86)\CA\SAM\app\uploads\{tag}  => C:\Program Files (x86)\CA\SAM\app\uploads\{tag}_OLD
  • C:\Program Files (x86)\CA\SAM\env\php => C:\Program Files (x86)\CA\SAM\env\php_OLD
*** (Replace {tag} by installation name (e.g. production / prod, integration, or demo)
 
 
Step 8 – Create the following directories (adjust as necessary for your installation):
  • C:\Program Files (x86)\CA\SAM\app\htdoc\{tag}
  • C:\Program Files (x86)\CA\SAM\app\includes\{tag}
  • C:\Program Files (x86)\CA\SAM\app\uploads\{tag}
  • C:\Program Files (x86)\CA\SAM\tmp (may already exist)
  • C:\Program Files (x86)\CA\SAM\tmp\upload (may already exist)
  • C:\Program Files (x86)\CA\SAM\tmp\session (may already exist)
  • C:\Program Files (x86)\CA\SAM\doc (may already exist)
  • C:\Program Files (x86)\CA\SAM\env\php
*** (Replace {tag} by installation name (e.g. production / prod, integration, or demo)
 
Step 9 – From C:\TEMP\SAM, copy
  • htdocs => C:\Program Files (x86)\CA\SAM\app\htdoc\{tag}
  • include => C:\Program Files (x86)\CA\SAM\app\includes\{tag}
  • doc => C:\Program Files (x86)\CA\SAM\doc
*** (Replace {tag} by installation name (e.g. production / prod, integration, or demo)
 
Step 10 – Setting permissions. User IUSR (IIS_IUSRS on Windows Server 2012 and 2016) must have Read, Write, Modify and Delete permission for the following folders:
  • c:\Program Files (x86)\ca\Sam\app\htdocs\ ("Write", "Modify" and "Delete" for application update only)
  • c:\Program Files (x86)\ca\Sam\app\includes\ ("Write", "Modify" and "Delete" for application update only)
  • c:\Program Files (x86)\ca\Sam\app\uploads\
  • c:\Program Files (x86)\ca\Sam\tmp\
 
Step 11 – User IUSR (IIS_IUSRS on Windows Server 2012 and 2016) must have Read and Read & Execute permission for the folders and files:
  • c:\Program Files (x86)\ca\Sam\env\
Step 12 – Edit the file C:\Program Files (x86)\CA\SAM\app\includes\{tag}\st\config.ini, adjust all values to your system, at least the following (note that you can copy and paste values from the old CONFIG.INI found in C:\Program Files (x86)\CA\SAM\app\includes\{tag_OLD}\st\config.ini):
  • relative_app_root
  • upload_path
  • executable_files_path
  • java_executable
  • java_jdbc_path
  • Under [database] add the data for your database connection
    • system
    • host
    • db
    • driver
    • user
    • password
    • port
    • engine is not important for SQL Server and can be skipped
 
NOTE - If your installation does not follow standard schema, be sure to also change the settings in htdocs\{tag}\include_path.ini
 
Step 13 –  PHP-Interpreter (CGI) Download the PHP 7.1 binaries for Windows:

·Download the VC14 x64 Non Thread Safe as a Zip file

  • Unzip to c:\Program Files (x86)\ca\Sam\env\php\
  • Rename php.ini-production to php.ini
 
Step 14 – Edit C:\Program Files (x86)\ca\Sam\env\php\php.ini:
NOTE All path specifications in php.ini should only use forward slashes (/) and double-quotes. Please note that some of the following key words are commented out via a semicolon. In this case remove the semicolon to activate the setting.
  • output_buffering = Off
  • zlib.output_compression = Off
  • ignore_user_abort = On
  • max_execution_time = 72000
  • max_input_time = 3600
  • memory_limit = -1
  • log_errors = On
  • error_log = syslog
  • post_max_size = 1500M ;(or higher)
  • extension_dir = “C:/Program Files (x86)/ca/sam/env/php/ext/”
  • cgi.force_redirect = 0
  • cgi.rfc2616_headers = 0
  • upload_tmp_dir = “C:/Program Files (x86)/ca/sam/tmp/upload/”
  • upload_max_filesize = 1500M ;(or higher)
  • extension = php_gd2.dll
  • extension = php_openssl.dll
  • extension=php_mbstring.dll
  • date.timezone = (must be set to the application serverlocal timezone. See http://www.php.net/en/timezones.php for a complete list)
  • session.save_path = “c:/Program Files (x86)/ca/sam/tmp/session/”
  • session.gc_maxlifetime = 86400
  • session.use_trans_sid = 0
 
Step 15 – SourceGuardian (PHP 7.1)
  • Download the SourceGuardian Loader package (https://www.sourceguardian.com/loaders.html) corresponding to your system.
  • Add the driver file ixed.7.1.win from the zip file to the PHP extensions directory (C:\Program Files (x86)\ca\Sam\env\php\ext\)
  • Edit C:\Program Files (x86)\CA\SAM\env\php\php.ini and add 'extension=ixed.7.1.win' directive
 
Step 16 – Download and install Visual C++ Redistributable for Visual Studio 2015 (http://www.microsoft.com/en-us/download/details.aspx?id=48145) . Please be aware, that the website will offer you the x64 version as a default. If you use the x86 version of PHP 7.0 you also need the x86 version of this package.
 
Step 17 – sqlsrv for PHP 7.1
  • Download the Windows 64-bit at
 https://www.microsoft.com/en-us/download/details.aspx?id=55642
  • Extract the .dll files from the package.
  • Copy php_sqlsrv_71_nts_x64.dll or php_sqlsrv_71_nts_x86.dll to php's extension directory
(default: c: \Program Files (x86)\ca\Sam\env\php\ext\) corresponding to your PHP installation.
  • Add the following line to the extension section in php.ini:
    • extension= php_sqlsrv_71_nts_x64.dll
    • (replace x64 by x86 on x86 installations)
 
Step 18 – Open Control Panel>System and Security>System>Advanced system settings>Environment Variables>System variables:
  • Add
    • Name: "OPENSSL_CONF"
    • Value: "c:\Program Files (x86)\ca\Sam\env\php\extras\ssl\openssl.cnf"
  • The server needs to be restarted after adding environment variables
 
Step 19 – Go to Administrative Tools > Internet Information Services Manager > Computername:
User-added image
 
In Handler-Mappings > Add Module Mapping set the following:
  • request path: *.php
  • Module: FastCgiModule
  • executable: "c:\Program Files (x86)\ca\Sam\env\php\php-cgi.exe" (The double quotes are necessary.)
  • Name: PHP
  • Open Request Restrictions, set "Invoke handler only if request is mapped to" and choose File or folder.
Click OK twice. Confirm any security queries
 
Step 20 – Go to Default Documents > Add and enter index.php:
User-added image
 
Step 21 – Go to Logging > Actions and set Enable (if not already activated).
 
Step 22 – Edit FastCGI Settings:
  • Double click on your handler mapping
  • Set Activity Timeout, Idle Timeout and Request Timeout each to 36000
 
Step 23 – Configuration Editor
  • Choose the section "system.webServer/handlers"
  • Open the "(Collection)" settings
  • Choose the module mapping PHP
  • Set "responseBufferLimit" to 0
  • Click Yes when you are asked to apply the changes
 
Step 24 - Set document root in IIS Manager to c:\Program Files (x86)\ca\Sam\app\htdocs\
 
Step 25 – Launch a browser and connect to your SAM prod installation. You should get a prompt to upgrade the database. Select Update.
 User-added image     User-added image

User-added image