duanjia6959 2017-06-01 01:34
浏览 70

如何在PHP中调试语法错误:T_CONSTANT_ENCAPSED_STRING? [重复]

This question already has an answer here:

I am having some issues with my website. I originally had:

Fatal error: Allowed memory size of x bytes exhausted

but after I tried to fix that I now have a new error and I just can't figure out what is wrong.

So here is the error message: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRINGin/data/9/3/38/56/3038056/user/3375037/htdocs/healteam6/wp-includes/default-constants.php on line 45

and here is the code below.

<?php
/**
 * Defines constants and global variables that can be overridden, generally in wp-config.php.
 *
 * @package WordPress
 */

/**
 * Defines initial WordPress constants
 *
 * @see wp_debug_mode()
 *
 * @since 3.0.0
 *
 * @global int $blog_id
 */
function wp_initial_constants() {
   global $blog_id;

/**#@+
 * Constants for expressing human-readable data sizes in their respective number of bytes.
 *
 * @since 4.4.0
 */
define( 'KB_IN_BYTES', 1024 );
define( 'MB_IN_BYTES', 1024 * KB_IN_BYTES );
define( 'GB_IN_BYTES', 1024 * MB_IN_BYTES );
define( 'TB_IN_BYTES', 1024 * GB_IN_BYTES );
/**#@-*/

$current_limit     = @ini_get( 'memory_limit' );
$current_limit_int = wp_convert_hr_to_bytes( $current_limit );

// Define memory limits.
if ( ! defined( 'WP_MEMORY_LIMIT' ) ) {
    if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
        define( 'WP_MEMORY_LIMIT', $current_limit );
    } elseif ( is_multisite() ) {
        define( 'WP_MEMORY_LIMIT', '64M' );
    } else {
        define( 'WP_MEMORY_LIMIT', ‘128M' );
    }
}

if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {
    if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
        define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
    } elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) {
        define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
    } else {
        define( 'WP_MAX_MEMORY_LIMIT', '256M' );
    }
}

// Set memory limits.
$wp_limit_int = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT );
if ( -1 !== $current_limit_int && ( -1 === $wp_limit_int || $wp_limit_int > $current_limit_int ) ) {
    @ini_set( 'memory_limit', WP_MEMORY_LIMIT );
}

if ( ! isset($blog_id) )
    $blog_id = 1;

if ( !defined('WP_CONTENT_DIR') )
    define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down

// Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development.
if ( !defined('WP_DEBUG') )
    define( 'WP_DEBUG', false );

// Add define('WP_DEBUG_DISPLAY', null); to wp-config.php use the globally configured setting for
// display_errors and not force errors to be displayed. Use false to force display_errors off.
if ( !defined('WP_DEBUG_DISPLAY') )
    define( 'WP_DEBUG_DISPLAY', true );

// Add define('WP_DEBUG_LOG', true); to enable error logging to wp-content/debug.log.
if ( !defined('WP_DEBUG_LOG') )
    define('WP_DEBUG_LOG', false);
</div>
  • 写回答

1条回答 默认 最新

  • dongzhentiao2326 2017-06-01 01:36
    关注

    This line here:

    define( 'WP_MEMORY_LIMIT', ‘128M' );
    

    Right before the 128M there is a fancy quote, change it to a proper one:

    define( 'WP_MEMORY_LIMIT', '128M' );
    
    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)