Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.4k views
in Q2A Core by
When I try to install the Question and Answers - there is a error - The config file could not be found. Please read the installation instructions.

All the information is up to date.

Please help

2 Answers

0 votes
by
Part of the installation process is to rename qa-config-example.php to qa-config.php, so please make sure you performed that step.
by
edited by
I have already done that. I have renamed the file and all the MySQL information is there, but still I am getting this message.

I have checked the qa-base.php file under the - qa-include directory and it seems that this error is listed as a fatal error there.

    if (!file_exists(QA_BASE_DIR.'qa-config.php'))
        qa_fatal_error('The config file could not be found. Please read the installation instructions.');


I dont have much knowledge about php.

Please help if anyone has the answer
by
Please insert the following line before the one causing the error:

echo QA_BASE_DIR.'qa-config.php';

Then refresh the page. The expected full path name of the config file will be output to your browser. You can compare this against the actual full path name (as shown by your FTP client, assuming you're using that).

Please post another comment here including both the expected and actual path names, and I'll try to help further.
by
I have inserted the line in qa-base.php.

Now I am getting the message as -

C:\Inetpub\vhosts\managementstudyguide.com\httpdocs\qa\qa-include/qa-config.phpThe config file could not be found. Please read the installation instructions.

I am using FTP only.

Please check
by
Thanks for your response. I think this is a bug in the code, where it doesn't work correctly in your particular server environment.

Please try fixing it by copying the following line from the start of qa-include/qa-index.php to the start of index.php in your qa directory:

define('QA_BASE_DIR', dirname(empty($_SERVER['SCRIPT_FILENAME']) ? __FILE__ : $_SERVER['SCRIPT_FILENAME']).'/');

Make sure you *remove* this line from index.php after it is inserted into qa-index.php. In index.php, it should be inserted before this line: require 'qa-include/qa-index.php';

Please post here whether this fixes the problem.
by
Thanks for your response.

I have inserted the following code  in - index.php (under the main "qa" folder)

define('QA_BASE_DIR', dirname(empty($_SERVER['SCRIPT_FILENAME']) ? __FILE__ : $_SERVER['SCRIPT_FILENAME']).'/');

and I removed it from - qa-index.php file.

Now I get a Welcome Screen - "Welcome to Question2Answer. It's time to set up your database!.................."
There is a button which says  - "Create Database including User Management". As soon as I click on this button - There is a Error message  - "Not Found - The requested document was not found on this server. "

The path in the Browser is as follows:

http://www.managementstudyguide.com/qa/index.php/install

So it seems that its looking for an "install" file in index.php directory.

Please help
by
OK, this is a different problem. It seems that your web server is not allowing a trick that Q2A uses, which is to have a path after index.php even though index.php is not a directory. I will need to check into this...
by
Hi,

Thanks for your response. I would highly appreciate if you can let me know how to fix this problem

Thanks
Himanshu
by
hi, I am still waiting for a fix to the above problem.

Please can you let me know if there is a reolution for this problem.
0 votes
by
I will need to address this properly in a future version, but in the meantime, here is a possible workaround:

1. In the function qa_path() in qa-base.php, replace the line:

    $paramsextra='';

... with ...

    $paramsextra='?qa='.urlencode($request);

2. Later in that same function, remove this line:

    .( ($neaturls || empty($request)) ? $request : ('index.php/'.$request) )

3. In qa-index.php, insert the following code:

    if (isset($_GET['qa'])) {
        $qa_request_parts=explode('/', $_GET['qa']);
        $qa_url_depth=1;
    }

... before ...

    $qa_request=implode('/', $qa_request_parts);

That should do it, but please let me know if it works for you, after testing out all the different functions on your site.
by
Hey....it seems to be working as of now.

Thanxxx a lot buddy. You are a genius.

If I come across any other problem.....I will get back to you....

Thanxxx once again
...