wordpress 我们可以解决我的问题与复印机语法错误行10?

xcitsw88  于 11个月前  发布在  WordPress
关注(0)|答案(1)|浏览(100)

我有一个小问题,我的网站,我使用WordPress的,我第一次在本地制作我的网站,但当我使用插件复制器,我试图通过installer.php安装在OVH有一个语法问题,出现在第10行,除了仔细看,我什么也没看到.

<?php
/* ------------------------------ NOTICE ----------------------------------

If you're seeing this text when browsing to the installer, it means your
web server is not set up properly.

Please contact your host and ask them to enable "PHP" processing on your
account.
----------------------------- NOTICE --------------------------------- */
namespace {
    use Duplicator\Libs\DupArchive\DupArchiveExpandBasicEngine;
    $disabled_dirs = array(
        'backups-dup-lite',
        'wp-snapshots'
    );
    if (in_array(basename(dirname(__FILE__)), $disabled_dirs)) {
        die;
    }
    define('KB_IN_BYTES', 1024);
    define('MB_IN_BYTES', 1024 * KB_IN_BYTES);
    define('GB_IN_BYTES', 1024 * MB_IN_BYTES);
    define('DUPLICATOR_PHP_MAX_MEMORY', 4096 * MB_IN_BYTES);
    date_default_timezone_set('UTC'); // Some machines don’t have this set so just do it here.
    @ignore_user_abort(true);
    function isIniValChangeable($setting)
    {
        static $ini_all;
        if (!isset($ini_all)) {
            $ini_all = false;
            if (function_exists('ini_get_all')) {
                $ini_all = ini_get_all();
            }
        }
        if (isset($ini_all[$setting]['access']) && ( INI_ALL === ( $ini_all[$setting]['access'] & 7 ) || INI_USER === ( $ini_all[$setting]['access'] & 7 ) )) {
            return true;
        }
        if (!is_array($ini_all)) {
            return true;
        }
        return false;
    }
    @set_time_limit(3600);
    if (isIniValChangeable('memory_limit')) {
        @ini_set('memory_limit', DUPLICATOR_PHP_MAX_MEMORY);
    }
    if (isIniValChangeable('max_input_time')) {
        @ini_set('max_input_time', '-1');
    }
    if (isIniValChangeable('pcre.backtrack_limit')) {
        @ini_set('pcre.backtrack_limit', PHP_INT_MAX);
    }
    if (isIniValChangeable('default_socket_timeout')) {
        @ini_set('default_socket_timeout', 3600);
    }

字符串
我尝试了几次下载installer.php和.zip复制器,以防其中一个损坏。我在网上看了很多教程,但我没有找到我的问题的解决方案。

uidvcgyl

uidvcgyl1#

你可以随时运行php -l yourscript.php或者使用在线的PHP linter(只要确保不要粘贴任何秘密的东西,比如密码)。
我假设你的错误是Parse error: Unclosed '{' on line 10 in your code on line 54
如果是这样的话,你在namespace上有一个{,但是这个{永远不会用}关闭。

相关问题