1

I would like to use php 5.6 with Winginx.

I tried to create a folder php56 and put the php package into it, but the php-config.exe will not "see" this folder.

How can I configure this php version in Winginx?

Jürgen Hörmann
  • 462
  • 4
  • 17

5 Answers5

2
<?php
/*
After applying this patch you can use "php56" and "php70"
folders in the root directory of winginx.
*/
function patch($file, $offset, $old_data, $new_data) {
    if (!$f = fopen($file, 'r+b')) {
        die("Can not open $file");
    }
    fseek($f, $offset);
    $c = fread($f, strlen($old_data));
    if ($c == $old_data) {
        fseek($f, $offset);
        fwrite($f, $new_data, strlen($new_data));
        echo "$file patched successfully\n";
    } else if ($c != $new_data) {
        die("$file can not be patched\n");
    }
    fclose($f);
}
patch('winginx.exe', 0x0A6254, 2, 6);
patch('winginx.exe', 0x0AD2DC, 2, 6);

patch('winginx.exe', 0x0AD258 5, 7);
patch('winginx.exe', 0x0AD25C 3, 0);
patch('winginx.exe', 0x0AD2EA 5, 7);
patch('winginx.exe', 0x0AD2EC 3, 0);

patch('php-config.exe', 0x014FCE, 2, 6);
patch('php-config.exe', 0x014FDC, 5, 7);
patch('php-config.exe', 0x014FDE, 3, 0);

echo "Done\n";
sax0n
  • 21
  • 2
2
<?php
/*
After applying this patch you can use "php56", "php70" and "php71"
folders in the root directory of winginx.
*/
function patch($file, $offset, $old_data, $new_data) {
    if (!$f = fopen($file, 'r+b')) {
        die("Can not open $file");
    }
    fseek($f, $offset);
    $c = fread($f, strlen($old_data));
    if ($c == $old_data) {
        fseek($f, $offset);
        fwrite($f, $new_data, strlen($new_data));
        echo "$file patched successfully\n";
    } else if ($c != $new_data) {
        die("$file can not be patched\n");
    }
    fclose($f);
}
patch('winginx.exe', 0x0A6254, 2, 6); // 5.2 -> 5.6
patch('winginx.exe', 0x0A6258, 5, 7);  
patch('winginx.exe', 0x0A625C, 3, 0); // 5.3 -> 7.0
patch('winginx.exe', 0x0A6260, 5, 7);
patch('winginx.exe', 0x0A6264, 4, 1); // 5.4 -> 7.1

patch('winginx.exe', 0x0AD2DC, 2, 6); // 5.2 -> 5.6
patch('winginx.exe', 0x0AD2EA, 5, 7);
patch('winginx.exe', 0x0AD2EC, 3, 0); // 5.3 -> 7.0
patch('winginx.exe', 0x0AD2FA, 5, 7);
patch('winginx.exe', 0x0AD2FC, 4, 1); // 5.4 -> 7.1

patch('php-config.exe', 0x014FCE, 2, 6); // 5.2 -> 5.6
patch('php-config.exe', 0x014FDC, 5, 7);
patch('php-config.exe', 0x014FDE, 3, 0); // 5.3 -> 7.0
patch('php-config.exe', 0x014FEC, 5, 7);
patch('php-config.exe', 0x014FEE, 4, 1); // 5.4 -> 7.1

echo "Done\n";

to update mysql to latest 5.7 release:

  • download latest zip versin
  • extract mysqld.exe and share folder to the mysqll folder of winginx
  • use this my.ini

    [mysqld]
    basedir=../mysql
    datadir = data
    bind-address = 127.0.0.1
    socket=mysql.sock
    log_syslog=0
    log_error_verbosity=1 # 1=errors; 2=+warnings; 3=+notices
    
  • rename data folder to something else (to backup data)
  • run from mysql filder of winginx

    ./mysqld.exe --initialize-insecure --console --datadir=data --basedir=../mysql
    

nginx, nodejs and redis could be updated the same way. download latest release, replace binaries and play with configs

Sax0n
  • 36
  • 2
0

You can do like this,

PHP settings; First, download to php ( http://windows.php.net/download/ ) and copy to C:/php. After, create to php64.bat on your desktop and write to inside C:\php\php-cgi.exe -b 127.0.0.1:5800, run the file.

Winginx settings; change to this of your "Server Config" tab; Find:

location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9054;

Replace:

location ~ \.php$ {
    fastcgi_pass 127.0.0.1:5800;

After, Save and restart nginx.

Serhat
  • 396
  • 1
  • 5
  • 13
  • Thanks for your help. My question was how PHP 5.6 can be used with WinGinx. Setting up a "standalone" instance of php makes the use of Winginx pointless. I like the easy configuration options in WinGinx and would prefer to use them. – Jürgen Hörmann Nov 25 '14 at 14:48
0

Try...

For php 5.6.7 - https://github.com/z2z/winginx_php56

For mysql or mariadb - https://gist.github.com/z2z/eb3d1415c2521da76b20

For nGinx - You directly replace nginx.exe with the latest.

z2z
  • 519
  • 1
  • 8
  • 16
  • Did you patch PHP to report a different version number? – Jürgen Hörmann Apr 10 '15 at 06:28
  • Yes. You have to patch it, as versions are hardcoded in winginx. You can use any of this folders .. ` "/php5/", "/php52/", "/php53/", "/php54/", "/php55/", "/php4/", "/php3/", "/php/"` – z2z Apr 10 '15 at 09:43
-1

Here u are: https://www.dropbox.com/s/10mkdporeils7ct/winginx_php56_support.exe I just reedit and now it support php 5.6.

Just download from php.net 5.6 php and place to winginx_folder/php56 Also u need copy config php-cgi from previous version.

  • Because your suggestion to download random binaries from private dropbox accounts doesn't inspire much confidence. Also, it doesn't explain what you did, or how you did it. Please edit your post to explain what you did, so that other people in the future can reproduce it with more recent versions of the software in question. – Wouter Verhelst Feb 17 '16 at 12:03