КОИНС.Студия - Статьи - Инсталляция и настройка программ - php - Upgrade PHP 5.5 to PHP 7.0 on Windows

Upgrade PHP 5.5 to PHP 7.0 on Windows

  • Install Visual C++ Redistributable for Visual Studio 2015:
    https://www.microsoft.com/en-us/download/details.aspx?id=48145

  • Download and unpack
    http://windows.php.net/download/

  • Download APCu extension:
    https://pecl.php.net/package/APCu
    Place it in ext/ directory.

  • Change settings in httpd.conf:
    PHPIniDir d:/www/server/php-7.0/
    LoadModule php7_module d:/www/server/php-7.0/php7apache2_4.dll

  • Add path to PHP directory to system variable named PATH

  • Rename directory with old PHP installation to prevent accidental usage of older version in CLI. In my case, I renamed
    d:\www\server\php-5.6
    to
    d:\www\server\-php-5.6

  • Move the following files:
    server/apache/bin/libeay32.dll
    server/apache/bin/ssleay32.dll
    to server/apache/bin/php-5.6 subdirectory.
    Copy these two files to server/apache/bin from server/php-7.0.

  • php.ini-development rename to php.ini

  • Update settings in php.ini:
    extension_dir = d:/www/server/php-7.0/ext/
    realpath_cache_size = 256K
    realpath_cache_ttl = 32767

  • Uncomment the inclusion of the following extensions:
    extension=php_curl.dll
    extension=php_fileinfo.dll
    extension=php_gd2.dll
    extension=php_mbstring.dll
    extension=php_mysqli.dll
    extension=php_openssl.dll
    extension=php_soap.dll
    extension=php_sockets.dll
    extension=php_tidy.dll
    extension=php_xmlrpc.dll

    Add the following to a list of loaded extensions:
    zend_extension=php_opcache.dll

  • Add the following at the very end of php.ini:
    [APCu]
    extension=php_apcu.dll
    apc.stat=1
    apc.shm_size=128M
    apc.user_entries_hint=8192
    apc.user_ttl=600
    apc.write_lock=1
  • Check the following settings to suite your needs:
    max_execution_time
    memory_limit

  • Update addr.php in all your projects:
    define('ALL_PHP_PATH','d:/www/server/php-7.0/');
    define('ALL_PHP_EXE','d:/www/server/php-7.0/');
    define('ALL_PHP_INI','d:/www/server/php-7.0/');

Additional steps

Последняя модификация: 07.03.16 20:35