Nasıl tuzak (Perl eval vardır) ölür bir PHP komut dosyası hatası için?

2 Cevap php

Hi I've got a script which works fine on our development server but dies on the clients server.

error_reporting(E_ALL);
if (function_exists('simplexml_load_file')) echo "function exists";
if (file_exists('test.xml'))
{
echo("<hr>just about to read local xml file :".__LINE__); 
$xml = simplexml_load_file('test.xml');   // dies here

Perl, size, PHP eşdeğer bir şey eval ile tuzak böyle hatalar var olabilir?

2 Cevap

İşlev başarısız hangi şekilde bağlıdır.

simplexml_load_file(), hata bilgisi olan well documented durumunda

Hataları, FALSE dönecektir.

ve

Produces an E_WARNING error message for each error found in the XML data.

ve

Use libxml_use_internal_errors() to suppress all XML errors, ve libxml_get_errors() to iterate over them afterwards.

And, you can always set your own error hveler or use the (troublesome) error suppression operator.

Sysadmin:- I've briefly turned on verbose error reporting and it's come back with this:

Fatal error: Cannot clone object of class SimpleXMLElement due to 'zend.ze1_compatibility_mode' in

http://archives.devshed.com/forums/php-108/simplexml-problem-982459.html

This configuration can be overridden on a per site basis with a .htaccess file directive http://www.activecollab.com/forums/topic/616/

Bu sorunu çözdük. Ama neden benim komut dosyası içinde raporlama hata bu seviyede açmak değil mi?