找个php探针,放上去试试,一般如果虚拟主机会这样,有些函数被禁用掉了,如phpinfo()

解决方案 »

  1.   

    首先我没有用虚拟机,其次phpinfo()可以正常执行.
    补充:没有在安全模式下 并且该文件的权限是 755 
    但有点小奇怪的是我重装完系统后 打开终端 显示的是 :
    [root@hr-linda~]#
    但我身边所有的人显示的都是[root@localhost~]#
    这是为什么?不知是否有关/?
      

  2.   

    问题解决了.因为我插着网线装系统.所以进入终端显示的不是[root@localhost~]# 
    所以没办法运行exec
      

  3.   


    补充:已经将一个能运行出来的环境下的 /etc/php.ini 文件覆盖了我本身的文件
    -------------------------
    是不是你把 /usr/local/php5/php.ini 用 /etc/php.ini 覆盖掉了?也就是说你现在的apache用的是 /usr/local/php5/php.ini ?我也有类似问题,tst.php 权限是 755 ,但exec()不能用。<?php
             $file = "1.php";
            $new_file = "1.bak.php";
            
            //$arr = array($file,$new_file);
            
            if(file_exists($file))
            {
                echo "$file file is exists ";
            }
            else
            {
                exec("/bin/cp $file $new_file");
                //system也试过,不行
            }
            
            if(file_exists($new_file))
            {
                echo "$new_file file is exists.";
            }
            else
            {
                echo "$new_file file not exists.";
            }
    ?>
    大哥指点!!!谢谢!
      

  4.   


    补充:已经将一个能运行出来的环境下的 /etc/php.ini 文件覆盖了我本身的文件
    -------------------------
    是不是你把 /usr/local/php5/php.ini 用 /etc/php.ini 覆盖掉了?也就是说你现在的apache用的是 /usr/local/php5/php.ini ?我也有类似问题,tst.php 权限是 755 ,但exec()不能用。<?php
             $file = "1.php";
            $new_file = "1.bak.php";
            
            //$arr = array($file,$new_file);
            
            if(file_exists($file))
            {
                echo "$file file is exists ";
            }
            else
            {
                exec("/bin/cp $file $new_file");
                //system也试过,不行
            }
            
            if(file_exists($new_file))
            {
                echo "$new_file file is exists.";
            }
            else
            {
                echo "$new_file file not exists.";
            }
    ?>
    大哥指点!!!谢谢!