Search code examples
phpwordpress.htaccessquestion2answer

500 Error when trying to define path to parent directory


I am trying to integrate Wordpress with Question2Answer so that they both use the same database for users. The instructions for doing this are pretty straight-forward. All I need to do is define the directory for my Wordpress installation in the Question2Answer config file. Unfortunately, no matter how I define the path to the Wordpress directory, I get a 500 error.

The urls for the installations are:

Wordpress: http://stage.example.com

Question2Answer: http://stage.example.com/ask

The directory structure is

Wordpress: public_html/stage

Question2Answer: public_html/stage/ask

Definition:

define('QA_WORDPRESS_INTEGRATE_PATH', '../');

I've tried 100 different ways to define the path to the Wordpress directory in my Question2Answer config file and I keep getting a 500 error. I'm fairly certain that I am defining the path to the directory correctly so I think it must be some sort of permissions or .htaccess problem but I'm not sure what it could be. Any ideas?

Here is the error:

PHP Question2Answer fatal error: Could not find wp-load.php file for WordPress integration - please check QA_WORDPRESS_INTEGRATE_PATH in qa-config.php


Solution

  • This might be silly, but keep in mind that the whole define('QA_WORDPRESS_INTEGRATE_PATH', '/PATH/WORDPRESS/'); is in a comment line. So you have to put the */ before the define line.

    I was also struggling a lot, until I saw this post