环境Linux php+apache+mysql 在.php文件中不执行exec(); 找个php探针,放上去试试,一般如果虚拟主机会这样,有些函数被禁用掉了,如phpinfo() 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 首先我没有用虚拟机,其次phpinfo()可以正常执行.补充:没有在安全模式下 并且该文件的权限是 755 但有点小奇怪的是我重装完系统后 打开终端 显示的是 :[root@hr-linda~]#但我身边所有的人显示的都是[root@localhost~]#这是为什么?不知是否有关/? 问题解决了.因为我插着网线装系统.所以进入终端显示的不是[root@localhost~]# 所以没办法运行exec 补充:已经将一个能运行出来的环境下的 /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."; }?>大哥指点!!!谢谢! 补充:已经将一个能运行出来的环境下的 /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."; }?>大哥指点!!!谢谢! php查询mysql数据库 查询条件为中文字符串变量时无法查询 急!php打印预览功能,及打印分页的实现? 如何修改PHP访问文件路径?? 关于获取列表框的值 用什么函数? 一个创建数据表的语句 请教各位高手:如何设置Apache服务器的缓冲区大小? PHP 把数组更新到数库里如何操作 读吧.net 书网2.0系统 下载(www.read8.net) 一个字符串替换的问题 IIS+PHP4.21 出问题。。 可不可以在输入框中直接显示图片? php ldap 取得ou结构 问题
补充:没有在安全模式下 并且该文件的权限是 755
但有点小奇怪的是我重装完系统后 打开终端 显示的是 :
[root@hr-linda~]#
但我身边所有的人显示的都是[root@localhost~]#
这是为什么?不知是否有关/?
所以没办法运行exec
补充:已经将一个能运行出来的环境下的 /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.";
}
?>大哥指点!!!谢谢!
补充:已经将一个能运行出来的环境下的 /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.";
}
?>大哥指点!!!谢谢!