日期:2014-05-17  浏览次数:20452 次

一个关于 include 文件 非常蹊跷的问题
各位大虾,请教一个问题:

我在写一个php的网页,所有的功能在本地 通过 localhost/../index.php访问,一切正常。
因为涉及到别人访问的问题,于是我将代码拷贝到服务器的/var/www上,结果代码运行错误,后来一看,是卡在这里了,但是不知道为什么。代码如下:

<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <?php
        
        echo "11111111";
        include_once('./cebu_parser.php');
        eccho "2222222"
        include_once('./flight_info_2_json.php');

        $cebu_parser = new cebu_parser();

        ?>
    </body>
</html>

在服务器上,只能运行到 echo "111111111", 查看生成的html代码如下:

<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        11111111111


也就是说代码只运行到第一句echo哪里。

我也将 include_once 替换成 include, require_once,require,都一个样子。

也尝试了 try catch的方法,但还是没有任何信息输出。

恳请各位解惑,谢谢
服务器 PHP

------解决方案--------------------
请你从你的程序文件中复制出代码粘贴上来
你贴出的代码有语法错误,根本就不能运行!
------解决方案--------------------
第二个echo  少分号
------解决方案--------------------
没明白解决你的什么问题。
不过对于include其实没什么,明白php的内核机制就好了。
http://www.laruence.com/2010/05/04/1450.html
你可以参考一下,写的还是不错的
------解决方案--------------------
cebu_parser.php
这里面exit了吧?
------解决方案--------------------
每个文件里都是什么代码???分析下或者先调试被包含的文件
------解决方案--------------------
error_reporting(E_ALL);

如果还是不行,贴出你的cebu_parser.php文件代码