I downloaded sentry-php library from
https://github.com/getsentry/sentry-php/archive/1.8.3.zip

Unpacked so that sites/all/libraries/raven/lib/Raven/Client.php is available

But still get

Sentry PHP library cannot be loaded. Check reports for more details.

Comments

nicolabeghin created an issue. See original summary.

mfb’s picture

Status: Active » Postponed (maintainer needs more info)

Should be at sites/all/libraries/sentry-php/lib/Raven/Client.php

If you put it there does it work? And if documentation is giving you the wrong path, let me know where that is.

mfb’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed

Assuming you worked this out, if not please re-open

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

morphosis7’s picture

I'm not sure whether this comment will re-open the issue, but I had the same issue that the original poster did - I didn't see any instructions for installing the Sentry PHP library without using Composer, so I took a guess that I could put it at sites/all/libraries/sentry/ - and that didn't work.

Checking the issue queue, I saw this ticket, and noted that I got the library name wrong. Once I changed it to sentry-php (making the path to Client.php "/sites/all/libraries/sentry-php/lib/Raven" ), the message on the status report went away.

If I missed the advice on where the library needed to be put, I apologize. What I saw on the status report said only

"The Sentry PHP library could not be loaded. Please install Sentry PHP library." with a link to GitHub.

I didn't see a path on the configuration screen either.

At any rate, your clarification about the path got me up and running. Thanks!

mfb’s picture

The documentation in the dev branch is:

The Sentry PHP library could not be loaded. Please install <a href="@url" target="_blank">Sentry PHP library</a> either via composer, or using libraries and xautoload modules. For instructions see the Raven module README.md file.

I guess I can tweak it to mention that actual directory you should install it into, for those who aren't reading the README.

It's tricky because I try to put everything in the README, but then folks don't read the README, so I end up having documentation all over the place... :p

dasumin’s picture

Hi! I'm having an issue as well. I've put the sentry-php library:

# ls -la /var/www/html/sites/all/libraries/sentry-php/lib/Raven/Client.php
-rwxr-xr-x 1 www-data www-data 48222 Oct 14 12:51 /var/www/html/sites/all/libraries/sentry-php/lib/Raven/Client.php

But it is not detected. I see the following in admin/reports/status:

The Sentry PHP library could not be loaded. Please install Sentry PHP library and its dependencies (Monolog and PSR Log).

I've tried also to put Monolog and PSR Log to sites/all/libraries with no effect.

mfb’s picture

@dasumin What version of this module are you using? Monolog and PSR Log have not been required in quite some time - you should try using the current version.

dasumin’s picture

@mfb thank you and sorry, my fault. Copied the plugin some time ago, setup it only these days and forgot to update it. Now resolved.

bfuzze9898’s picture

I am experiencing this issue too. The class_exists function in raven_libraries_load function is failing.

If I clear the cache and add a check inside this if condition, it does respond correctly, but after that the condition fails.

Changing the class_exists autoload parameter to TRUE, has no effect.

Initially, I installed sentry via composer, which is the recommended way I believe, in sites/all/libraries. The resulting path to the Client being: sites/all/libraries/vendor/sentry/sentry/lib/Raven/Client.php. Then I tried the manual installation, as the original poster did, in sites/all/libraries/raven/lib/Raven/Client.php. This did not work either.

I did not try xautoload, but maybe I should.

The only solution, which is not a solution, was to hack the module and add an explicit require before the class_exists call
(e.g. require_once DRUPAL_ROOT . '/sites/all/libraries/vendor/autoload.php';). I'm sure I can come up with a more elegant solution by adjusting module weights and/or doing this call in my own module, but there is clearly some issue with resolving the path to the sentry library.

Would it be possible to add a config variable to specify/override path to sentry-lib, or do you have another solution?

Thanks.

UPDATE: I can confirm that adding the above require to a custom module and then setting the your custom module weight to anything less than the Raven module corrects this issue (require path will vary based on your sentry installation method).

mfb’s picture

The README.md lays out your two installation options.

Option 1): Install via composer, along with a module which takes care of autoloading your composer dependencies. The README.md recommends https://www.drupal.org/project/composer_autoloader as a good option for this.

Option 2): Install to sites/all/libraries/sentry-php along with https://www.drupal.org/project/libraries and https://www.drupal.org/project/xautoload

If you have any recommendations for clarifying the README.md, please update this issue as I'd appreciate it :)

mfb’s picture

I went ahead and made some updates to the README which /might/ help a little(?)

Paul_T’s picture

I recently had the same issue as the original post and the fix was to ensure file ownership was set properly (using CHOWN). I was using a different SSH user when I pulled in the PHP library.