j3-rest-api icon indicating copy to clipboard operation
j3-rest-api copied to clipboard

Basic installation

Open mrutgerj opened this issue 11 years ago • 12 comments
trafficstars

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.

mrutgerj avatar May 03 '14 02:05 mrutgerj

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

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

fastslack avatar May 03 '14 03:05 fastslack

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 https://github.com/chrisdavenport/j3-rest-api/issues/4#issuecomment-42094761.

mrutgerj avatar May 03 '14 03:05 mrutgerj

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?

fastslack avatar May 03 '14 03:05 fastslack

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 https://github.com/chrisdavenport/j3-rest-api/issues/4#issuecomment-42095108.

mrutgerj avatar May 03 '14 03:05 mrutgerj

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

fastslack avatar May 03 '14 05:05 fastslack

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 https://github.com/chrisdavenport/j3-rest-api/issues/4#issuecomment-42097147.

mrutgerj avatar May 03 '14 13:05 mrutgerj

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

fastslack avatar May 04 '14 23:05 fastslack

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 https://github.com/chrisdavenport/j3-rest-api/issues/4#issuecomment-42150671.

mrutgerj avatar May 05 '14 00:05 mrutgerj

Check this patch from my fork:

https://github.com/fastslack/j3-rest-api/compare/chrisdavenport:master...master

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

fastslack avatar May 05 '14 04:05 fastslack

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

foo123 avatar Aug 14 '14 13:08 foo123

any solution for mysql error plz?

munimnal avatar Nov 07 '15 14:11 munimnal

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

fastslack avatar Nov 07 '15 18:11 fastslack