我在windows 上写好的php项目,运行什么的都没有问题。
ubuntu上的php环境也是配好的,用的nginx。配好后运行phpinfo.php 是没问题的。问题:
 我今天把刚写的php项目放在ubuntu server 的www目录下,执行命令:http:// ip /practice/admin.php?controller=admin&method=login   之后也没报错 ,就是个空白页面,什么内容也没有?这是什么情况?这个项目用的smarty模板写的。

解决方案 »

  1.   

    两边的 php 配置应一致
    最好打开 php 的错误显示功能,或将错误定向的文件
    你只显示空白页(实际是 500 错),是因为错误信息无处去,把服务器堵死了smarty 需要写文件,请确认相关目录有写权限
    使用 smarty 的项目,不要上传 template_c 目录(注意你可能改了名)中的内容,如果启用了缓存,也不要上传缓存目录中的内容
      

  2.   

    我window用的环境是xampp ,ubuntu上用的是nginx,刚才把template_c中的内容删除了, 我把www文件夹赋予了 777 权限,缓存也启用了,但是我这是第一次接触到缓存,也不知道它这个目录在哪,我并没有定义缓存目录,只在admin.php中写了session_start(); ,但是还是不行,,
      

  3.   

    php.ini 中另display_errors=On 然后重启服务器后试一下。
      

  4.   

    打开错误提示。
    在页面顶加上<?php
    ini_set('display_errors','on');
    error_reporting(E_ALL);
    ?>
      

  5.   


    错误提示:Warning: require_once(/libs/controller/adminController.class.php): failed to open stream: No such file or directory in /usr/share/nginx/www/practice1/framework/function/function.php on line 3 Fatal error: require_once(): Failed opening required '/libs/controller/adminController.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/nginx/www/practice1/framework/function/function.php on line 3 是路径问题,这个linux下路径下应该怎么改
      

  6.   


    已经打开了,谢谢你,报错是路径问题Warning: require_once(/libs/controller/adminController.class.php): failed to open stream: No such file or directory in /usr/share/nginx/www/practice1/framework/function/function.php on line 3 Fatal error: require_once(): Failed opening required '/libs/controller/adminController.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/nginx/www/practice1/framework/function/function.php on line 3