• Resolved aenea

    (@aenea)


    I just installed the Duplicator plugin as I want to clone a web site so I can use it for test purposes. Have created the install.php and .zip files and put them in place. But when I run the install.php program I get the following error message:

    Parse error: syntax error, unexpected T_FUNCTION in /var/sites/t/test.sustainability-in-practice.org.uk/public_html/installer.php on line 1081

    Here is the code in installer.php around line 1081:

    // Let’s use anonymous function after PHP5.3.0 – is faster than create_function()
    // create_function() is removed from PHP 7.2
    if(DUPX_U::isVersion(‘5.3.0’)) {
    // Use “try catch” to avoid PHP notice or error below PHP5.3.0
    try {
    $walk_function = function () use (&$str) {
    $str = “$str“;
    };
    }
    catch (Exception $exc) {}
    } else {
    $walk_function = create_function(‘&$str’, ‘$str = “$str“;’);
    }

    Line 1081 is the line that starts $walk_function

    I am running PHP v7.1.5

    Can anyone tell me what to do to get around this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • That should be fixed in the latest version of the plugin, what version of the plugin are you using?

    Thxs

    Thread Starter aenea

    (@aenea)

    Version 1.2.34. Just installed it from the WordPress repository today.

    Hey @aenea,

    My bad! The fix still has not been pushed… If you can give the developer version a try it should have the updates for your issue. The very latest version (1.2.35) can be found by following these instructions:

    Download Developer Version
    – Uninstall your current version and install this one.

    Let me know if this solves your issue~

    Thanks

    Thread Starter aenea

    (@aenea)

    Thanks for that. Turns out I had a mistake as well. Although the site that I wanted to clone was running PHP v7.1.5, the subdomain I had created for installing the clone was running PHP v5.2. Once I had installed Duplicator v1.2.35, the installer reported this problem (instead of crashing as it did with v1.2.34). Then, once I had upgraded my subdomain to running PHP v7.1.5, the installation was able to proceed.

    Wasn’t plain sailing, however. The installation halted, saying there were problems with the zip file. I tried unzipping it on my PC, as recommended, which detected that there were file paths that were too long in the PHP Compatibility Checker plugin. Deleted this plugin and remade the zip file but again the installation halted, grumbling about the zip file. This zip file unzipped with no problems on my PC and there were no warnings about invalid names when I created it. So, I resorted to unzipping it on my web host and installing using the manual extraction option. Success at last. Time for a celebratory drink ??

    Thanks for the update! We are currently working on a custom archive engine to get around all the issue presented by PHP ZipArchive. Look for it later this year it should solve all the problems you ran into.

    Cheers~

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Installation fails with unexpected T_FUNCTION’ is closed to new replies.