Title: Exec-PHP error: &lt;?php becomes &lt; ?php
Last modified: May 8, 2019

---

# Exec-PHP error: <?php becomes < ?php

 *  [clickfaster](https://wordpress.org/support/users/clickfaster/)
 * (@clickfaster)
 * [7 years ago](https://wordpress.org/support/topic/exec-php-error-php-becomes-php/)
 * My WP version = 5.1.1
    My PHP version = 5.2.4
 * This isn’t really an exec-php problem. PHP opening tags are getting munged.
 * A recent update to WordPress caused this problem – not sure which version.
 * In a multi-post page view of posts that include the <!–more–> tag, the opening
   tag for PHP was getting corrupted with an added space between < and ?php. If 
   you viewed the offending post by itself, the error would go away.
 * There’s probably a more elegant way to fix this, but here’s my solution:
 * **Edit:** wp-includes/formatting.php file
    **After line 2558:** $newtext = str_replace(‘
   < !–‘, ‘< !–‘, $newtext ); **Add:** $newtext = str_replace(‘< ?php’,'<?php’,$
   newtext);
    -  This topic was modified 7 years ago by [clickfaster](https://wordpress.org/support/users/clickfaster/).

The topic ‘Exec-PHP error: <?php becomes < ?php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/exec-php.svg)
 * [Exec-PHP](https://wordpress.org/plugins/exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/exec-php/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [clickfaster](https://wordpress.org/support/users/clickfaster/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/exec-php-error-php-becomes-php/)
 * Status: not resolved