Fix Textpattern: Parse Error: Syntax Error, Unexpected ‘yield’

admin-ajax

Textpattern CMS is a powerful-yet-flexible content management system for building websites upon. Textpattern is installable software that, by its nature, runs on atop a variety of operating systems. At a high level, its system requirements are:

  • A fairly recent version of PHP
  • A fairly recent version of MySQL
  • An http-serving suite like Apache

Within the loose confines of the above requirements, there’s a lot of variation in real-world scenarios. There are numerous revisions and updates made to PHP, MySQL and Apache as their respective development continues. Textpattern works on a server with at least PHP 5.2.3 and MySQL 4.1.0; PHP 5.2.3 was released in May 2007, and MySQL 4.1.0 came out in April 2003. Both of these versions of the software are no longer supported by the vendor and have been superseded numerous times.

It’s fair to say, then, that Textpattern is an appropriate choice where cutting- or bleeding-edge software is not prevalent. There are occasions where Textpattern gets snagged on certain configurations, and this series of articles will explain some of these troubleshooting situations, along with solutions where appropriate. Some of these relate to recent updates to software, while others are perennial problems that relate to poorly configured servers.

If you’re running an Arvixe VPS, you have significantly more control over the versions of software installed than shared hosting. Thankfully, Textpattern runs smoothly on Arvixe servers and most other shared hosting. If you do encounter any problems, then check the Textpattern forum in the first instance as many problems have been already solved. Searching for the error message you’re seeing is an excellent place to start. You can do this from your preferred search engine, or from the Textpattern forum search function.

Recently, PHP versions 5.5 and 5.6 have been released; 5.5 came out in mid-2013, while 5.6 was released in mid-2014. Both of these releases included notable changes to the way PHP works, and as such this has a knock-on effect with Textpattern. Some of the functionality in the latest Textpattern release (version 4.5.5 at the time of writing) conflicts with recent versions of PHP. There’s nothing on the front-end that tells your users that there’s a problem, but you may well see errors appearing in the administration interface. One such error is:

Parse error: syntax error, unexpected 'yield' (T_YIELD), expecting '(' in /[...]/textpattern/publish/taghandlers.php on line 313

This error occurs because PHP 5.5 added a new keyword named `yield`. This collides with the Textpattern-specific `yield` tag, and things get a little wobbly. The solution to this error is to either downgrade PHP to 5.4, or drop in the updated files listed on the issue tracker (https://code.google.com/p/textpattern/source/detail?r=5501).

Shared hosting denizens will not see this error as the PHP versions installed to Arvixe shared hosting are intentionally behind the latest versions, preferring stability and reliance to brand-new functionality.

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting and use coupon TEXTPATTERN for 20% off your first invoice!

Tags: , , , , , , , , , , , | Posted under Textpattern | RSS 2.0

Author Spotlight

Pete Cooper

Pete Cooper has been using Textpattern since 2005. Textpattern is his preferred CMS weapon of choice. Its logical and flexible approach to content management makes Pete happy, as does its lightweight core and helpful user community. Pete's website - petecooper.org - runs on top of Textpattern and chronicles his day-to-day experiences from his home near the Atlantic in north Cornwall, United Kingdom.

Leave a Reply

Your email address will not be published. Required fields are marked *