Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic installation #4

Open
mrutgerj opened this issue May 3, 2014 · 12 comments
Open

Basic installation #4

mrutgerj opened this issue May 3, 2014 · 12 comments

Comments

@mrutgerj
Copy link

mrutgerj commented May 3, 2014

I unpacked the api to the root folder, but when visiting http://pathto/joomla/api, I get a mysql connect error:

{"message":"Could not connect to MySQL.","code":0,"type":"RuntimeException"}

Is there a configuration setting I missed? I cp'ed the default htaccess.txt to .htaccess, and added the rules at the bottom as per the instructions.

@fastslack
Copy link
Contributor

Did you try adding the "etc" directory to your root?

https://github.com/chrisdavenport/j3-rest-api/tree/master/etc

@mrutgerj
Copy link
Author

mrutgerj commented May 3, 2014

Yes, I double checked that the three directories are in localhost,
apache server, on xubuntu. Could this be a permissions error? What file
reads the configuration.php settings?

Thanks for your response...

On 05/02/2014 08:14 PM, Matias Aguirre wrote:

Did you added the "etc" directory to your root?

https://github.com/chrisdavenport/j3-rest-api/tree/master/etc


Reply to this email directly or view it on GitHub
#4 (comment).

@fastslack
Copy link
Contributor

Is strange, i never got that issue. If your Joomla! installation havent issues with the mysql connection I do not understand the reason that API returns this error.

The database instance is loaded here:

https://github.com/chrisdavenport/j3-rest-api/blob/master/api/application/web.php#L98

Which version of Joomla! are you using?

@mrutgerj
Copy link
Author

mrutgerj commented May 3, 2014

I was on 3.2.3 with the former error. I just upgraded to the latest,
3.3.0, and now get a different error:

Fatal error: Class 'JRegistry' not found
in_/var/www/truemileage/libraries/joomla/application/web.php_on line*117

On 05/02/2014 08:37 PM, Matias Aguirre wrote:

Is strange, i never got that issue. If you Joomla! installation havent
issues with the mysql connection I do not understand the reason that
API returns this error.

Which version of Joomla! are you using?


Reply to this email directly or view it on GitHub
#4 (comment).

@fastslack
Copy link
Contributor

Check the solution for this bug. Just replace the file api/import.php for this one:

https://github.com/fastslack/j3-rest-api/blob/jregistry-fix/api/import.php

@mrutgerj
Copy link
Author

mrutgerj commented May 3, 2014

That is strange with the Registry and something to watch out for.
Nonetheless, I am still unable to connect.

{"message":"Could not connect to MySQL.","code":0,"type":"RuntimeException"}

It seems to throw the exception on line 1071 of web.php ---

 session->start()

I am certain that the credentials in configuration.php are correct. I
have also set my livesite var.

On 05/02/2014 10:46 PM, Matias Aguirre wrote:

I found the solution for this bug. Just replace the file
api/import.php for this one:

https://github.com/fastslack/j3-rest-api/blob/jregistry-fix/api/import.php


Reply to this email directly or view it on GitHub
#4 (comment).

@fastslack
Copy link
Contributor

You can debug this method and see if you are receiving the correct paramerters to connect with your mysql database:

https://github.com/chrisdavenport/j3-rest-api/blob/master/api/application/web.php#L98

@mrutgerj
Copy link
Author

mrutgerj commented May 5, 2014

I debugged, and it turned out the the options for the DB had a missing
password and schema, which I ended up hardcoding.

That leads to a different error, same file line 194:

JPluginHelper::importPlugin('authentication');

not found.

On 05/04/2014 04:28 PM, Matias Aguirre wrote:

You can debug this method and see if you are receiving the correct
paramerters to connect with your mysql database:

https://github.com/chrisdavenport/j3-rest-api/blob/master/api/application/web.php#L98


Reply to this email directly or view it on GitHub
#4 (comment).

@fastslack
Copy link
Contributor

Check this patch from my fork:

fastslack/j3-rest-api@chrisdavenport:master...master

Look at the file api/application/web.php into this file you can found the JLoader class for plugins.

@foo123
Copy link

foo123 commented Aug 14, 2014

Have same issue here (Joomla 3.3, not using htaccess) it is local test install

get the JRegistry error

Fatal error: Class 'JRegistry' not found in C:\nikos\work\_nikos\open_source\git\nikos\work\scandinavik\libraries\joomla\application\web.php on line 117

@munimnal
Copy link

munimnal commented Nov 7, 2015

any solution for mysql error plz?

@fastslack
Copy link
Contributor

@munimnal please try with this fork https://github.com/fastslack/j3-rest-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants