错误提示:Parse error: syntax error, unexpected '/' in D:\web\dgtn1718\web\data\tags.php on line 2tags.php第二行的代码是:require_once (dirname(str_replace("\","/",__FILE__)) . "/include/common.inc.php"求助高手帮忙解答,将“\"改为"\\"这样出现之前的问题。Warning: require_once(D:\web\dgtn1718\web\data/include/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in D:\web\dgtn1718\web\data\tags.php on line 2
Fatal error: require_once() [function.require]: Failed opening required 'D:\web\dgtn1718\web\data/include/common.inc.php' (include_path='.;C:\php5\pear') in D:\web\dgtn1718\web\data\tags.php on line 2
求助求助织梦phptags.php

解决方案 »

  1.   

    unexpected '/' in...
    是'/'不是'\'
      

  2.   

    require_once (dirname(str_replace("\\","/",__FILE__)) . "/include/common.inc.php"
      

  3.   

    改成str_replace("\\","/",__FILE__)) 就变成下面出现的错误了
      

  4.   

    回复于: 2013-04-16 14:27:57
    unexpected '/' in...
    是'/'不是'\'能详细点吗?
      

  5.   

    那就是路径错误了,当前目录下没有 /include/common.inc.php 文件。
      

  6.   

    common.inc.php 文件放在include目录下的
      

  7.   


    require_once(dirname(str_replace("\\","\/",__FILE__))."/include/common.inc.php");提示啥错误啊,没有发出来
      

  8.   


    Warning: require_once(D:/web/dgtn1718/web/data/include/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in D:\web\dgtn1718\web\data\tags.php on line 2Fatal error: require_once() [function.require]: Failed opening required 'D:/web/dgtn1718/web/data/include/common.inc.php' (include_path='.;C:\php5\pear') in D:\web\dgtn1718\web\data\tags.php on line 2
      

  9.   


    PHP code?1require_once(dirname(str_replace("\\","\/",__FILE__))."/include/common.inc.php")改成你这样的话就出现这样的错误了:Warning: require_once(D:\/web\/dgtn1718\/web\/data/include/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in D:\web\dgtn1718\web\data\tags.php on line 2Fatal error: require_once() [function.require]: Failed opening required 'D:\/web\/dgtn1718\/web\/data/include/common.inc.php' (include_path='.;C:\php5\pear') in D:\web\dgtn1718\web\data\tags.php on line 2
      

  10.   

    就是路径问题,include 在 D:\web\dgtn1718\web\data 目录下吗,怎么你贴的图是ftp的?
      

  11.   


    难道要下载源程序在本地D盘吗?这是公司的网站,源文件都放在ftp上的,
      

  12.   

    很明显的提示这两个文件不存在:
    D:\web\dgtn1718\web\data\tags.php
    D:/web/dgtn1718/web/data/include/common.inc.php而看到你的那张图的路径为:
    222.186.191.25/include/common.inc.php
    改为这样试一下define("WWWROOT",str_ireplace(str_replace("/","\\",$_SERVER['PHP_SELF']),'',__FILE__)."\\");
    echo (dirname(str_replace("\\","/",WWWROOT))."/include/common.inc.php");这才改了common.inc.php,另一个tags.php也一样,试试
      

  13.   

    你没发现问题所在吗?你看下路径撒~
    你用__FILE__得到不是网站根目录,而是当前的路径,仔细看啊,路径里是不是多了个"web/data"
    将:require_once(dirname(str_replace("\\","\/",__FILE__))."/include/common.inc.php");替换为:define("WWWROOT",str_ireplace(str_replace("/","\\",$_SERVER['PHP_SELF']),'',__FILE__)."\\");
    require_once(dirname(str_replace("\\","/",WWWROOT))."/include/common.inc.php");看看是不是common.inc.php能找到了,另一个也一样
      

  14.   

    第2行define("WWWROOT",str_ireplace(str_replace("/","\\",$_SERVER['PHP_SELF']),'',__FILE__)."\\");
    第3行require_once(dirname(str_replace("\\","/",WWWROOT))."/include/common.inc.php");
      

  15.   

    好吧,将str_ireplace改为str_replace
      

  16.   

    我要是你这样我就直接require_once("目测路径");
    http://www.im286.com/thread-9211178-1-1.html
      

  17.   

    权限问题 在ftp里把文件的权限设置为可读取
      

  18.   

    如果是linux空间ftp登录右键该文件 设置777如果是windows的空间 需要主机管理如果是服务器 需要登录服务器设置
      

  19.   

    织梦还没看完 看完再告诉你 话说 才看了 一个php页面