Title: exec-PHP &#8211; not executing in posts (single.php)
Last modified: August 19, 2016

---

# exec-PHP – not executing in posts (single.php)

 *  [mhuffs9017](https://wordpress.org/support/users/mhuffs9017/)
 * (@mhuffs9017)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/exec-php-not-executing-in-posts-singlephp/)
 * OK, I’ve read the topics on making the change to the exec-PHP include file runtime.
   php. I still can’t get any PHP code to execute in a single post, single.php. 
   I have no issues getting it to run on a page, page.php.
 * Any ideas?
 * Code is not html edited, WYSIWYG is off. I’m at a loss.
 * <?php echo “hello”; ?>

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [mhuffs9017](https://wordpress.org/support/users/mhuffs9017/)
 * (@mhuffs9017)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/exec-php-not-executing-in-posts-singlephp/#post-1281060)
 * Topic ref is:
 * [http://wordpress.org/support/topic/281992](http://wordpress.org/support/topic/281992)
 *  [ibooktravel](https://wordpress.org/support/users/ibooktravel/)
 * (@ibooktravel)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/exec-php-not-executing-in-posts-singlephp/#post-1281325)
 * me too. I can’t get the simple `<?php echo "hello"; ?>` to execute either. It
   just simply shows the php like text. See [http://www.ibookTravel.com.au](http://www.ibookTravel.com.au)
 *  [burnsmicro](https://wordpress.org/support/users/burnsmicro/)
 * (@burnsmicro)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/exec-php-not-executing-in-posts-singlephp/#post-1281331)
 * I am new to WP and I am not having any success inserting some php in a few posts
   and pages.
 * I have followed these steps:
 * 1.Signed on as Administrator
    2.Added and activated EXEC-Php and Deactivate Visual
   Editor plugins. 3.Created a new blank page 4.Disabled the Visual Editor on the
   new page: Custom Fields → deactivate_visual_editor = true 5.Disabled tag balancing
   in Settings → Write. 6.Assumed, as administrator I have “unfiltered html” capability,
   since I do not see how to activate this feature. 7.Assumed, as administrator 
   I have “exec php” capability. 8.In the Editor (with no Visual or HTML tabs), 
   type in: <?php echo “This is the Exec-PHP ‘Hello World'”; ?>
 * The Preview shows:
    <?php echo “This is the Exec-PHP ‘Hello World'”; ?>
 * I then modified …/plugins/exec-php/includes/runtime.php by inserting:
 *  if(strpos($content,'< ?php ‘)!==FALSE)
    { $content=str_replace(‘< ?php’,'<?php’,
   $content); } ..at the start of “function filter_user_content($content)” right
   after “global $post;”, as suggested [above](http://wordpress.org/support/topic/281992?replies=7),
   with comments claiming miraculous results.
 * But, no miracle. The page preview still shows:
 * <?php echo “This is the Exec-PHP ‘Hello World'”; ?>
 * I have a feeling I am missing something obvious. Can someone point it out to 
   me?
 *  [missbossy](https://wordpress.org/support/users/missbossy/)
 * (@missbossy)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/exec-php-not-executing-in-posts-singlephp/#post-1281356)
 * I had the same problem after resetting my user roles… this eliminated the permission
   for my id to write php code despite being admin. If this is happening, wordpress
   will be inserting <p> tags into your code and won’t render the PHP.
 * If you have somehow reset your user roles (ie permissions for user groups are
   definted in wp_user_roles) then try installing a backup. That database field 
   should include something like
 * s:8:”exec_php”;b:1;s:15:”edit_others_php”;
 * If there is no reference to exec_php, that’s your problem.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘exec-PHP – not executing in posts (single.php)’ is closed to new replies.

 * 4 replies
 * 4 participants
 * Last reply from: [missbossy](https://wordpress.org/support/users/missbossy/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/exec-php-not-executing-in-posts-singlephp/#post-1281356)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
