Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 489927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:51:27+00:00 2026-05-13T01:51:27+00:00

I have a site built with Symfony 1.2. I’m trying to integrate WordPress 2.8.4

  • 0

I have a site built with Symfony 1.2. I’m trying to integrate WordPress 2.8.4 into it to power my blog. I followed the instructions at http://www.theodo.fr/blog/2009/03/integrate-wordpress-into-symfony/, including the 2 steps in the comments at http://www.theodo.fr/blog/2009/03/integrate-wordpress-into-symfony/comment-page-1/#comment-573. My actions.class.php file looks like this:

 <?php
 class sfWordpressActions extends sfActions
 {
   public function executeIndex(sfWebRequest $request)
   {

     // Don't load symfony's I18N
     $standard_helpers = sfConfig::get('sf_standard_helpers');
     $standard_helpers = array_diff($standard_helpers, array('I18N'));
     sfConfig::set('sf_standard_helpers', $standard_helpers);

     define('WP_USE_THEMES', true);
     chdir( dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'wordpress' );
     global $wpdb;

     ob_start();
     require_once( 'wp-blog-header.php' );
     $this->blog = ob_get_contents();
     if (function_exists('is_feed') && is_feed())
     {
       ob_end_flush();
       throw new sfStopException();
     }
     else
     {
       ob_end_clean();
     }
   }
 }
    ?>

My indexSuccess.php is simply

This is a test
<?php echo $blog ?>

And my wp-blog-header.php is

<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */

if ( !isset($wp_did_header) ) {
  $wp_did_header = true;

  require_once( dirname(__FILE__) . '/wp-load.php' );

  // @HACK FABRICE
  // All variables defined here are considered global by WordPress
  $local_global_vars = get_defined_vars();
  foreach($local_global_vars as $local_name => $local_value)
  {
    $GLOBALS[$local_name] = $local_value;
  }
  // Don't create new global variables ourselves, and do not overwrite other global variables, for example $name...
  unset($local_name, $local_value, $local_global_vars);
  // @HACK FABRICE

  wp();

  // @HACK Fabrice
  global $posts;
  // @HACK Fabrice

  require_once( ABSPATH . WPINC . '/template-loader.php' );
}

Here’s my problem:

As it is, I get nothing when I go to the page. None of my Symfony headers, no WordPress content, nothing. When I comment out the line “require_once( ‘wp-blog-header.php’ );” in actions.class.php, everything works fine but there is no WordPress content. This leads me to believe that that Symfony is dying somewhere in the process of including the WordPress stuff. How this might be fixed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:51:28+00:00Added an answer on May 13, 2026 at 1:51 am

    I’ve written a follow-up guide to the helpful article on theodo.fr that works with the latest versions of WordPress and has steps for upgrading: http://blog.codeclarity.com/2009/12/02/integrating-symfony-and-wordpress/. I believe your conflict is the esc_js function defined by both Symfony and WordPress. If you run my command in step 4 you should be good to go with the latest version. Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so I have built this site: http://boardersforchrist.com/new/ and the owner wanted the footer
We have a hosted site that has a CMS we built running on a
I have a site built in Ruby On Rails which has many ads in
I have a site built with simple templates; header.tpl, navigation.tpl, body_home.tpl, body_about.tpl, body_anotherpage.tpl, etc.
We have a site built in Zend Framework and we're using the Zend Soap
I have uploaded a site built with asp.net 2.0 in a sub directory created
We have a web site built as an 'ASP.NET Website' type project, rather than
I have a web site built using asp.net with ugly URLs like /DisplayContent.aspx?id=789564 .
I have a site built on codeigniter but I have come accross a small
We have a site hosted in IIS6 that we built using the .NET 1.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.