开发者

codeigniter, php error - errot text problem

开发者 https://www.devze.com 2023-02-12 07:38 出处:网络
I use codeigniter framework in my project. I encountered php error. English errors display well~ but, there are some odd texts that can not be readable.

I use codeigniter framework in my project. I encountered php error. English errors display well~ but, there are some odd texts that can not be readable. like this...

A PHP Error was encountered

Severity: Warning

Message: simplexml_load_file(http://localhost/upload开发者_StackOverflow社区s/seoul.kml) [function.simplexml-load-file]: failed to open stream: ����� ��������κ��� ����� ��� �������� ���߰ų�, ȣ��Ʈ�κ��� ����� ��� ������ ������ϴ�.

Filename: controllers/editor.php

Line Number: 113

So, I think it's becase of text encoding~ . My project's setting is utf-8(Korean)) in config/congif.php.

$config['charset'] = "UTF-8";

But, I can not find where I should put html utf-8 setting like this.

in application/error/error_php.php file, I can not find a place to put my utf-8 setting like this. because it's just div tags, no html header.

<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: <?php echo $severity; ?></p>
<p>Message:  <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>

</div>

Or, is the crashed text is not a utf-8 problem? any idea please~


The problem seems to be that you cannot open the website and read from it. Is allow_url_fopen set to On in your PHP configuration?

EDIT

I was so quick I only saw the URL. Then the question is instead: Is the file readable?

Try:

<?php
$file = 'uploads/seoul.kml';

if ( file_exists($file) ) { 
  if ( is_readable($file) ) {
    print_r(simplexml_load_file($file));
  }
  else {
    echo "File is not readable";
  }
}
else {
  echo "File does not exist";
}
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消