Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP SimpleXML, CodeIgniter and Apache with Suhosin
    primarykey
    data
    text
    <p>I have an application I am writing in PHP5, using the CodeIgniter framework. I have it running on both Windows (using Xampp) and Ubuntu (using standard Apache, PHP, MySQL stack).</p> <p>I have a form, that takes XML, parses it (using simpleXML) and posts the results into a database.</p> <p>On Windows - no problem, works as intended.</p> <p>On Linux - big problem. It errors out.</p> <p>I have double checked the XML, and it's fine.</p> <p>I removed a large amount of the XML, and it seems that it is OK.</p> <p>I think it's related to the size of the XML string being posted from the form, but am not sure. Again, on Windows it's OK - on Linux, it errors out.</p> <p>The size of the data posted in the form is ~160k (yeah, that's a lot of text, but it's automated - AND it's gonna eventually be about 200k).</p> <p>The error is below.</p> <p>Any help much appreciated.</p> <blockquote> <p>Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/ci/system/application/controllers/system.php:49 Stack trace: #0 /var/www/ci/system/application/controllers/system.php(49): SimpleXMLElement->__construct('') #1 [internal function]: System->add_system() #2 /var/www/ci/system/codeigniter/CodeIgniter.php(233): call_user_func_array(Array, Array) #3 /var/www/ci/index.php(115): require_once('/var/www/ci/sys...') #4 {main} thrown in /var/www/ci/system/application/controllers/system.php on line 49</p> </blockquote> <p>Line 49 looks like this:</p> <p><code>$xml = new SimpleXMLElement($this-&gt;input-&gt;post('form_systemXML'));</code></p> <p>EDIT - FIXED</p> <p>Found the issue. Suhosin is installed on Ubuntu. in the file /etc/php5/apache2/conf.d/suhosin.ini, I enabled the line <code>suhosin.post.max_value_length = 65000</code> and changed the value to 195000. Restarted Apache, and all good. Thanks for the pointers guys.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload