Home  >  Article  >  Backend Development  >  一个关于 include 文件 非常蹊跷的问题

一个关于 include 文件 非常蹊跷的问题

WBOY
WBOYOriginal
2016-06-23 14:11:20878browse

各位大虾,请教一个问题:

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


nbsp;html>

    


        
        
    
    
                 
        echo "11111111";
        include_once('./cebu_parser.php');
        eccho "2222222"
        include_once('./flight_info_2_json.php');

        $cebu_parser = new cebu_parser();

        ?>
    


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


nbsp;html>

    
        
        
    
    
        11111111111


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

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

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

恳请各位解惑,谢谢


回复讨论(解决方案)

请你从你的程序文件中复制出代码粘贴上来
你贴出的代码有语法错误,根本就不能运行!

第二个echo  少分号

没明白解决你的什么问题。
不过对于include其实没什么,明白php的内核机制就好了。
http://www.laruence.com/2010/05/04/1450.html
你可以参考一下,写的还是不错的

cebu_parser.php
这里面exit了吧?

每个文件里都是什么代码???分析下或者先调试被包含的文件

error_reporting(E_ALL);

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

谢谢各位参与。问题找到了,是有一个文件中用到的方法在服务器上无法正确执行,所以在include的时候,他无法解释执行,所以直接不错了。但想不通,我本地的系统也没记着装了什么其他组件啊。

再次感谢大家!!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn