0

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

Thomas
  • 5,030
  • 20
  • 67
  • 100
  • What does your error logs say is generating the 500 error? – Jon Lin Jan 28 '14 at 06:01
  • I copied the error in above. It says that it couldn't find the wp-load.php file. But that doesn't make any sense because when I echo the path, it is correct. – Thomas Jan 28 '14 at 06:07
  • so you are trying to define a constant variable which represents a cd type of shell command to move down one directory with the `../` – user_loser Jan 28 '14 at 06:14
  • I've tried it many, many, different ways. I also used $_SERVER variables and the full path. – Thomas Jan 28 '14 at 06:15
  • have you gone to your main wordpress directory which is like public_html or something and issued the `pwd` command? Maybe what this prints out is what you should put in your `define` function. – user_loser Jan 28 '14 at 06:16
  • Yes - I copied and pasted it in. – Thomas Jan 28 '14 at 06:17
  • Which directory contains *wp-load.php.* ? – user_loser Jan 28 '14 at 06:18
  • So its in a subdomain (http://stage.mydomain.com) that is located in public_html/stage. The Question2Answer is installed in a normal directory inside that subdomain. – Thomas Jan 28 '14 at 06:19
  • You have the correct version *WordPress 3.x* ? – user_loser Jan 28 '14 at 06:20
  • The instructions specify to give the full path so this is probably the absolute path that is not dependent on where the file this function is written in is stored. So it would be something like `define('QA_WORDPRESS_INTEGRATE_PATH', /Full/path/to/directory/where-this-is/wp-load.php);` – user_loser Jan 28 '14 at 06:23
  • That is what I am using (I think). I used $_SERVER['DOCUMENT_ROOT']; to figure that out and then I plugged it in. If the path is incorrect, the script echos an error. If I plug in the correct path, I get a 500 error and it writes to the error log. – Thomas Jan 28 '14 at 06:26
  • Stage is a password protected directory, would that effect anything? – Thomas Jan 28 '14 at 06:27
  • The log for the 500 error says that the server cannot find the file though correct? I would find the file on the server, then issue the `pwd` command and copy and paste this path in your text editor to plug-in to the `define` function. Probably ask your web-host too what is wrong with the server. :D – user_loser Jan 28 '14 at 06:29
  • Yep, thats what I did. I will contact my host I guess. – Thomas Jan 28 '14 at 06:30
  • Sorry I could not help more. Good luck. – user_loser Jan 28 '14 at 06:31

1 Answers1

3

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

Sagar Sakre
  • 2,336
  • 22
  • 31