Title: [Plugin: PHP Code Widget] Executable PHP widget &#8211; Not Working
Last modified: August 20, 2016

---

# [Plugin: PHP Code Widget] Executable PHP widget – Not Working

 *  Resolved [acmc](https://wordpress.org/support/users/acmc/)
 * (@acmc)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/)
 * Uploaded executed the plugin
 * I have a custom widgetized sidebar on a template page.
 * Put in a query post call – showed nothing
 * Put in text – it’s there
 * Put in the <?php echo ‘testing!’; ?> and that didn’t show either…
 * Hu?
 * I have used this plugin before and it worked beautifully and unsure what I am
   doing wrong. Any help greatly appreciated.
 * Thanks
 * **Ann
 * [http://wordpress.org/extend/plugins/php-code-widget/](http://wordpress.org/extend/plugins/php-code-widget/)

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

 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/#post-2344750)
 * Dunno. Works fine for me.
 * Do you have any sort of caching plugins like super-cache or similar? Maybe you’re
   only seeing the cached version of the page. Clear the cache in that case.
 *  [souf](https://wordpress.org/support/users/souf/)
 * (@souf)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/#post-2344949)
 * Hi,
    I try to put only a include: `<?php include("http://url_smf/SSI.php?ssi_function
   =recentTopics"; ?>` And didn’t work: _Parse error: syntax error, unexpected ‘;’
   in /path\_to\_wordpress/wp-content/plugins/php-code-widget/execphp.php(44) : 
   eval()’d code on line 1_
 *     ```
       function widget( $args, $instance ) {
       		extract($args);
       		$title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );
       		$text = apply_filters( 'widget_execphp', $instance['text'], $instance );
       		echo $before_widget;
       		if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
       			ob_start();
       /*Line 44*/		eval('?>'.$text);
       			$text = ob_get_contents();
       			ob_end_clean();
       			?>
       			<div class="execphpwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div>
       		<?php
       		echo $after_widget;
       	}
       ```
   
 * I didn’t known the problem (it’s not the problem for use ” or ‘).
    I try to put
   a simple echo “Hello World”, and it works, but not with an a include… Thanks
 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/#post-2344950)
 * Well, this:
    `<?php include("http://url_smf/SSI.php?ssi_function=recentTopics";?
   >`
 * Isn’t valid PHP code.
 * For one thing, you’re missing the closing parenth.
 * For another, you’re trying to include an HTTP URL as PHP code, which is incorrect.
 *  [souf](https://wordpress.org/support/users/souf/)
 * (@souf)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/#post-2344951)
 * Sorry, I typed incorrectly the php code in the message, but it was right in the
   widget:
    `<?php include("http://url_smf/SSI.php?ssi_function=recentTopics"); ?
   >` I wrote this because it was only to simplify the php code and it would be 
   more easily understood.
 * Finally, if I include the php file, it works, but not with include(“…”)
 * The final code:
 *     ```
       <ul>
       <?php
       require("/path_to_smf/SSI.php");
       $Lista = ssi_recentPosts($num_recent = 10, $exclude_boards = null, $include_boards = null, $output_method = 'array');
       foreach ($Lista as $Post) {
   
       echo '<li><a target="_blank" href=', $Post['href'], '>', $Post['subject'], '</a></li>';
   
       }
       unset($Lista);
       ?>
       </ul>
       ```
   
 * Thanks
 *  [John](https://wordpress.org/support/users/jemoreto/)
 * (@jemoreto)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/#post-2344952)
 * Hello there!
    It just can’t execute shortcodes?? Very useful, miss this functionallity
   in this plugin. Thanks

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

The topic ‘[Plugin: PHP Code Widget] Executable PHP widget – Not Working’ is closed
to new replies.

 * ![](https://ps.w.org/php-code-widget/assets/icon.svg?rev=992095)
 * [PHP Code Widget](https://wordpress.org/plugins/php-code-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-widget/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [John](https://wordpress.org/support/users/jemoreto/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-executable-php-widget-not-working/#post-2344952)
 * Status: resolved