Libraries 7.x-2.0-alpha2
awssdk-1.5.4

After enabled, I get following message:
Warning: shell_exec() has been disabled for security reasons in require_once() (line 1409 of /home/mysite/public_html/drupal/sites/all/libraries/awssdk/sdk.class.php).

When trying to see Reports/Status report I get followinn message:
#! /usr/bin/env php ERROR: You may only run the compatibility test from the command line.

Is this because of the difference of the versions of awssdk and AWS SDK for PHP 7.x-5.2? If so, is there a place to download the ecommended SDK version 1.5.1?

I haven´t had this warning with previous versions.

Comments

boombatower’s picture

Category: bug » support
Status: Active » Closed (duplicate)

This has already been fixed in #1429614: Rewrite compatibility checking to take advantage of refactored SDK compatibility tests.

Now that it has been confirmed by others to work I will make a release.

Modern Smith’s picture

Version: 7.x-5.2 » 7.x-5.3
Priority: Major » Normal
Status: Closed (duplicate) » Active

With this new version I still get the same message:
Warning: shell_exec() has been disabled for security reasons in require_once() (line 1409 of /home/Mysite/public_html/drupal7/sites/all/libraries/awssdk/sdk.class.php).

However, this message appears now only on the Status report page. The compatibility tests shows ok.

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

The only references to shell_exec() are as follows.

$ grep -nR shell_exec .
./sites/all/modules/libraries/libraries.drush.inc:95:  if (!drush_shell_exec('type unzip')) {
./sites/all/modules/libraries/libraries.drush.inc:131:  if (!drush_shell_exec('wget '. COLORBOX_DOWNLOAD_URI)) {
./sites/all/modules/libraries/libraries.drush.inc:132:    drush_shell_exec('curl -O '. COLORBOX_DOWNLOAD_URI);
./sites/all/modules/libraries/libraries.drush.inc:137:    drush_shell_exec('unzip -qq -o '. $filename);

No of which are defined in awssdk module or Amazon library, but instead of defined in the libraries module in code that is only executed if you were to run the included drush command. The status page does not invoke that code, the old version did.

My only guess then is that line 1409 of sdk.class.php is using a weird PHPism that invokes shell_exec().

$_ENV['HOME'] = `cd ~ && pwd`;
if (!$_ENV['HOME']) // this line

Either way this is not something I can change and is definitely an environment setting/issue.

The same code exists in 1.5.0.1 and you mentioned 1.5.1 as being the first time you encountered error. https://github.com/amazonwebservices/aws-sdk-for-php/blob/1.5.0.1/sdk.cl...

My only thoughts then are
- are you sure you updated to 5.3
- try to enable shell_exec() in your environment
- don't worry about it assuming it still all works

Let me know what you find out. (also I would assume it will occur when you do something that actually invokes the sdk which will cause it to load like it does on the status page)

EDIT: `` do invoke shell_exec() I knew that, but did not notice that they were `` as opposed to ''. So that explains why it is used then.

boombatower’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Based on that I would say shell_exec() is a requirement of the Amazon SDK. If you want to bring this to their attention to possibly get it changed (I would same this is somewhat rare restriction) then you can file an issue in their github repo: https://github.com/amazonwebservices/aws-sdk-for-php

Modern Smith’s picture

Manyt thanks for your time and help. It really hadn´t anything to do with this module. It is up to Amazon or the site´s hosting provider. I managed to negotiate this with my hosting provider. They accepted to enable shell_exce(). But I´ll still file an issue in Amazon github.