douyi4912 2014-11-25 06:02
浏览 110
已采纳

无法在第66行的config.php中安装YOURLS(PHP Parse错误:语法错误,意外';',期待')')

I'm trying to install YOURLS but whenever I go to the admin page I get this error:

Anyway, can someone help me?

The config.php file I have is the following:

<?php
/* This is a sample config file.
* Edit this file with your own settings and save it as "config.php"
*/

/*
** MySQL settings - You can get this info from your web host
*/

/** MySQL database username */
define( 'YOURLS_DB_USER', 'MySQLUsername' );

/** MySQL database password */
define( 'YOURLS_DB_PASS', 'MySQLPassword' );

/** The name of the database for YOURLS */
define( 'YOURLS_DB_NAME', 'MySQLDatabase' );

/** MySQL hostname.
 ** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */
define( 'YOURLS_DB_HOST', 'MySQLHost' );

/** MySQL tables prefix */
define( 'YOURLS_DB_PREFIX', 'yourls_' );

/*
 ** Site options
 */

/** YOURLS installation URL -- all lowercase and with no trailing slash.
 ** If you define it to "http://example.com", don't use "http://www.example.com" in your browser (and vice-versa) */
define( 'YOURLS_SITE', 'http://example.com' );

/** Timezone GMT offset */
define( 'YOURLS_HOURS_OFFSET', 0 ); 

/** YOURLS language or "locale".
 ** Change this setting to "localize" YOURLS (use a translation instead of the default English). A corresponding .mo file
 ** must be installed in the user/language directory.
 ** See http://yourls.org/translations for more information */
define( 'YOURLS_LANG', '' ); 

/** Allow multiple short URLs for a same long URL
 ** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior)
 ** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */
define( 'YOURLS_UNIQUE_URLS', true );

/** Private means the Admin area will be protected with login/pass as defined below.
 ** Set to false for public usage (eg on a restricted intranet or for test setups)
 ** Read http://yourls.org/privatepublic for more details if you're unsure */
define( 'YOURLS_PRIVATE', true );

/** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/
define( 'YOURLS_COOKIEKEY', 'ogjorgjorgjOJFIJFEIJfejfejirporegohi' );

/** Username(s) and password(s) allowed to access the site. Passwords either in plain text or as encrypted hashes
 ** YOURLS will auto encrypt plain text passwords in this file
 ** Read http://yourls.org/userpassword for more information */
$yourls_user_passwords = array(
    'MyUsername' => 'MyPassword',

/** Debug mode to output some internal information

 ** Default is false for live site. Enable when coding or before submitting a new issue */

define( 'YOURLS_DEBUG', false );

/*
 ** URL Shortening settings
 */

/** URL shortening method: 36 or 62 */
define( 'YOURLS_URL_CONVERT', 62 );
/*
 * 36: generates all lowercase keywords (ie: 13jkm)
 * 62: generates mixed case keywords (ie: 13jKm or 13JKm)
 * Stick to one setting. It's best not to change after you've started creating links.
 */

/** 
* Reserved keywords (so that generated URLs won't match them)
* Define here negative, unwanted or potentially misleading keywords.
*/
$yourls_reserved_URL = array(
    'blocked', 'blocked2', 'blocked3', 'blocked4', 'blocked5', 'blocked6', 'b7', 'b8',
);

/*
 ** Personal settings would go after here.
 */

MySQL information and passwords shown are concealed (Keep that in mind).

  • 写回答

1条回答 默认 最新

  • dpxw7293 2014-11-25 06:04
    关注

    Your array is not getting closed.

    Go to line 59:

    Change

    $yourls_user_passwords = array(
        'MyUsername' => 'MyPassword',
    

    To:

    $yourls_user_passwords = array(
        'MyUsername' => 'MyPassword',
    );
    

    Hope it works for you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。