SimpleXML is PHP 5.x SimpleXML es PHP 5.x way to handle XML. manera de manejar XML. It is simpler than DOMXML (which incidentally is very poorly documented in manual or elsewhere) which is available on PHP 4.x and much simpler than SAX solutions. Es más simple que DOMXML (que por cierto es muy mal documentados en el manual o en otros lugares) que está disponible en PHP 4.x y mucho más simple que soluciones de SAX. However it doesn’t work with certain installations of PHP 5.x. Sin embargo, no funciona con ciertas instalaciones de PHP 5.x. Let’s see how we can solve it. Vamos a ver cómo podemos solucionarlo.

Problem Problema
I first came across this when I realized my code works in home machine and not on site. Llegué por primera vez en todo esto cuando me di cuenta de que mi código funciona en máquinas de la casa y no en el lugar. PHP as usual silently gives up (solution to this in next post). PHP en silencio como de costumbre se da por vencido (a esta solución en el próximo post). In essence simplexml_load_string returns false without actually creating and returning the object. En esencia simplexml_load_string devuelve falso sin llegar a crear y devolver el objeto. So you cannot use Por lo tanto, no se puede usar SimpleXML in any way. de ninguna manera.

Solution Solución
After some debugging I found the solution. Después de depuración he encontrado la solución. Here are the steps: Estos son los pasos:

1. Open php.ini ( Abrir php.ini ( How to find it? ¿Cómo encontrarlo? ) ),
2. Search for zend.ze1_compatibility_mode Buscar zend.ze1_compatibility_mode
3. Change it to Off as shown below Cambiar a Off como se muestra a continuación
zend.ze1_compatibility_mode = Off zend.ze1_compatibility_mode = Off
4. Save php.ini and restart Apache Guardar php.ini y reiniciar Apache

You are done! Usted está hecho!