【问题标题】:Error in configuring my old project配置我的旧项目时出错
【发布时间】:2017-11-16 10:57:32
【问题描述】:
<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg[Servers][$i][verbose] = localhost;
$cfg[Servers][$i][host] = localhost;
$cfg[Servers][$i][port] = "";
$cfg[Servers][$i][socket] = ‘/tmp/mysql.sock';  
$cfg[Servers][$i][connect_type] = socket;
$cfg[Servers][$i][extension] = mysqli;
$cfg[Servers][$i][auth_type] = config; 
$cfg[Servers][$i][user] = root;
$cfg[Servers][$i][password] = root;
$cfg[Servers][$i][AllowNoPassword] = true;

/* End of servers configuration */

$cfg[DefaultLang] = en-utf-8;
$cfg[ServerDefault] = 1; 
$cfg[UploadDir] = ;
$cfg[SaveDir] = ;

/* rajk - for blobstreaming */

$cfg[Servers][$i][bs_garbage_threshold] = 50;
$cfg[Servers][$i][bs_repository_threshold] = 32M;
$cfg[Servers][$i][bs_temp_blob_timeout] = 600;
$cfg[Servers][$i][bs_temp_log_threshold] = 32M;

?>


ERROR:- Parse error: syntax error, unexpected 'var' (T_VAR) in C:\wamp64\scripts\config.inc.php on line 11 

我想设置我的项目并遇到此错误,任何人都可以告诉我我在将旧项目设置为这个时所做的问题。在设置我的项目时尝试了很多次,在这个问题上遇到了同样的问题。

【问题讨论】:

  • 这里的代码着色应该是一个很大的线索!

标签: php configuration phpmyadmin wamp


【解决方案1】:

这一行的花式引用:

$cfg[Servers][$i][socket] = ‘/tmp/mysql.sock';  
                            ^ 
                          here

改成这样:

$cfg[Servers][$i][socket] = '/tmp/mysql.sock';  

此外,您应该像这样在索引周围加上引号:

$cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock'; 

【讨论】:

  • 现在遇到这个问题解析错误:语法错误,意外';'在 C:\wamp64\scripts\config.inc.php 第 23 行
  • 那是因为这些行$cfg[UploadDir] = ; $cfg[SaveDir] = ;,您没有为其设置任何值。我建议你看看一些基本的 PHP 语法指南,这些都是非常简单的问题。
  • 你能告诉我你的回答是否有帮助
  • 不懂你的意思,你自己决定。您需要将这些变量设置为某个值,即使它只是一个空数组 [] 或字符串 ''
  • 加上所有未引用的值,例如 socketmysqli
猜你喜欢
  • 1970-01-01
  • 2016-11-20
  • 2014-03-20
  • 2021-01-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多