---
title: "Joomla 3 error 500 on contact form serialization of XML"
date: "2013-03-11"
path: "/107-joomla-3-error-500-on-contact-form-serialization-of-xml.html"
section: "/ramblings"
aliases:
  - "/107"
  - "/107-joomla-3-error-500-on-contact-form-serialization-of-xml"
  - "/107.html"
  - "/ramblings/107-joomla-3-error-500-on-contact-form-serialization-of-xml.html"
---

Joomla 3.x Recaptcha validation fail with message:\
Error: 500 "Serialization of 'SimpleXMLElement' is not allowed"

Edit using nano the file:

```
libraries/cms/form/rule/captcha.php
```

On line 48 we have:

```
$captcha = JCaptcha::getInstance($plugin, array('namespace' => $namespace));
```

You need to cast the result as a string value like so:

```
$captcha = JCaptcha::getInstance($plugin, array('namespace' => (string) $namespace));
```

This is reference to the bug in Joomla:\
[http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=29570](http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=29570)

<div class="box-info">This is only a pre-Joomla 3.01 issue, after making this manual modification we actually just updated Joomla to the latest stable version via the standard update tool.</div>
