Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to solve error "Ajax requests to this URL require an X-Pjax header"


Go to End


4 Posts   1744 Views

Avatar
Voodoo Priest

Community Member, 32 Posts

29 September 2015 at 5:37am

Edited: 29/09/2015 5:52am

Hi,

I have upgraded a 2.4.13 instance to 3.0.3 and most of it went fine. I even spent a few days updating the website with v3.0.3. Then suddenly, I started getting JS errors such as "Enumerable is not defined" or "Class is not defined".

I then moved on today to 3.0.14, the latest version on the 3.0 branch.

Now, I am facing a "Ajax requests to this URL require an X-Pjax header." in the Firebug console. I have tried everything I could think of, clearing caches, etc. to no avail. When this error occurs, I can no longer access tabs other than the tab (Root.Content) on which the CMS opened the page: I can't reach Translation, Settings or any other tab.

Has anyone ever met this problem? How did you fix it?

I'm running SilverStripe on a CentOS 6.7 with the latest officially supported Apache and Mysql, and with php55w that I had to install from a third-party repository due to the officially supported PHP version having reached eol.

Thanks for any insights into this because the editing capability is essentially now limited.

Avatar
Voodoo Priest

Community Member, 32 Posts

1 October 2015 at 5:35am

Edited: 27/10/2015 3:11am

The post on these forums at http://www.silverstripe.org/community/forums/installing-silverstripe/show/51914 led me to switching the PHP processing model to FastCGI (from Mod-PHP, via ISPConfig). I don't know whether this change will make the error go away forever though, since the server had been working fine with Mod-PHP for over two years, including with SS v3.0.x until the error started showing up.
For now, changing from Mod-PHP to FastCGI seems to have done the trick.
HTH

EDIT: I've just met the same error again today (Oct 26). I'm still on FastCGI so I still don't know what causes this error.

Avatar
Faloude

Community Member, 55 Posts

1 February 2017 at 9:15am

I'm experiencing the same issue, most likely since I recently upgraded to CloudLinux.

Going to check if I can change the PHP processor and if this would fix it

Avatar
Voodoo Priest

Community Member, 32 Posts

5 February 2017 at 12:03pm

Edited: 05/02/2017 12:03pm

Faloude, I no longer have this problem but I haven't been able to identify the reason, nor the fix. Maybe that the problem is actually still present on the website but I don't experience it because I'm no longer creating as many pages as before; only one blog post here and there.
Sorry I can't help you more.