chrome未能成功加载php,PHP - 无法使用Chrome创建文件,但IE无法正常创建

我正在运行easyphp 14.1。

我通常使用Chrome来测试结束调试应用程序。

在我的项目中,我有一个日志类,它将日志写入文件中。如果文件不存在,则会创建该文件。

到目前为止,一切都运行良好,但今天,使用chrome时不再写日志。

我检查了文件夹权限,一切都很好看。

我尝试删除并手动重新创建文件夹和日志文件,但没有任何效果。

所以我尝试用IE打开我的项目,我不知道为什么,日志再次开始工作。

但是使用Chrome,它仍然无效。

我不理解所使用的浏览器与使用PHP在文件中写日志的操作之间的联系。

任何人都可以帮助我理解这种奇怪吗?

编辑:源代码

class clLog{

const erreur = "[ERROR]";

const warn = "[WARNING]";

const trace = "[TRACE]";

/**

*

* @param $dConfig: la config du fichier INI

* @param $msg: le message à afficher

* @param $level: niveau de trace

* @return

*/

public static function Debug($dConfig, $msg, $level=clLog::trace) {

// Ecriture selon le level

if($dConfig['log']['level'] > 1){

$path = $dConfig['path']['racine'].$dConfig['log']['debug_path'];

// Verifie l'existance du dossier de destination.

if(is_dir($path)){

// Instance de log afin d'utiliser la fonction d'écriture

$o = new clLog();

// Construit le message

$message = date('H:i:s')." ".$level." ".$msg."\r\n";

// Construit le path du fichier de log SQL d'aujourd'hui

$file = $path.$dConfig['log']['debug_file']."_".date('d-m-Y').".log";

// Ecriture dans fichier

$o->Ecrire($file, $message);

}

}

/**

* action: ecrit le message $msg à suite du fichier dont l'url est passée en paramètre

* paramètres:

* - url: adresse du fichier

* - msg: message à insérer

*retour: aucun.

*/

private function Ecrire($url, $msg)

{

$fp = fopen($url, 'a+');

fwrite($fp, $msg);

fclose($fp);

}

}

?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值