OJS 3.1.2 Plugin Gallery Error - Cannot Install ANY Plugin

I’ve installed OJS 3.1.2 from the .tar.gz file on a shared hosting service. Every time i try to install a plugin with the plugin gallery, the ajax request end with an error 500. When i change tab in the dashboard, a notification then appear with the phrase "Compressed file does not contain a folder with “The uploaded plugin archive does not contain a folder that corresponds to the plugin name.”

allow_url_fopen is enabled, there are no apache/php error (but thats because they arent visible on cpanel apparently)

Hi Manuel,

Aside from finding those logs which will tell you what the problem is, you can always download the plugin .tar.gz to your local machine, untar it, and then FTP the uncompressed directory up to the correct plugins/ subdirectory. Then you should be able to enable it in the plugin grid.

Cheers,
Jason

Hi Jnugent.

Yes, i know i can install it with ftp, but the person which will use it really want to use the gallery instead of downloading the tar.gz

Hi all,

Also, it’s better not to upload the plugin manually e.g. via FTP, because that might miss out on plugin installation steps that the OJS-based uploader/plugin gallery takes care of (like schema creation, registring the plugin with the OJS database, etc).

@Manuel_Tondelli, have you checked your PHP error log for more details?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher I didi, but it’s empty

Hi @Manuel_Tondelli,

A 500 error should always result in a log message. You may have to hunt for it.

Regards,
Alec Smecher
Public Knowledge Project Team

I’ve fond only some log file, but they didnt give me much info, because they all had this message:

51.179.112.58 - - [08/Sep/2019:19:43:38 +0000] “POST /ojs/index.php/ps/$$$call$$$/grid/plugins/plugin-gallery-grid/install-plugin?product=bootstrap3 HTTP/1.1” 500 20 “http://<HOSTNAME_REDACTED>/ojs/index.php/ps/management/settings/website” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36”

Hi @Manuel_Tondelli,

That looks like your access log, which is different than your error log. How do I find my PHP error log? might be of some help.

Regards,
Alec Smecher
Public Knowledge Project Team

I know, but those are the only logs that i’ve found

Hi @Manuel_Tondelli,

You might need to contact your system administrator to find out where the PHP error log is. It’ll be pretty hard to run anything without access to that – even if you can work out this issue, when something else goes wrong, you’ll be flying blind.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher We’ve contacted the system administrator, which helped us find the error log.
Here is an extract about the error: (I’ve redacted our domain for obvious reasons)

[26-Sep-2019 20:14:31 UTC] PHP Fatal error: Uncaught Error: Call to a member function getProductType() on string in /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/classes/plugins/PluginHelper.inc.php:115
Stack trace:
#0 /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/controllers/grid/plugins/PluginGalleryGridHandler.inc.php(266): PluginHelper->installPlugin(NULL, ‘Il file compres…’)
#1 /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/classes/core/PKPRouter.inc.php(390): PluginGalleryGridHandler->installPlugin(Array, Object(Request))
#2 /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#3 /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/classes/core/Dispatcher.inc.php(134): PKPComponentRouter->route(Object(Request))
#4 /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/classes/core/PKPApplication.inc.php(252): Dispatcher->dispatch(Objec in /home/antoniom/public_html/www.<REDACTED_DOMAIN>.com/ojs/lib/pkp/classes/plugins/PluginHelper.inc.php on line 115

Has anyone figured out my problem?

Hi @Manuel_Tondelli,

Is your server’s connection to the Internet behind an HTTP proxy?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher , I’m the site owner. The server is not behind a proxy.

Hi all,

It looks like OJS was able to download the plugin, but unable to extract it. Are you sure your tar binary is available to OJS and configured in config.inc.php in the tar setting in the cli section? For example:

[cli]
tar = /bin/tar

It seems as though that option is not correctly configured, or PHP is not being allowed to execute it.

Regards,
Alec Smecher
Public Knowledge Project Team