Snapshot AWS error

I just installed and activated Snapshot on a site but I am getting:

Warning: php_uname() has been disabled for security reasons in D:inetpubvhostsdomainname.comhttpdocswp-contentpluginssnapshotlibdestinationsawsAWSSDKforPHPsdk.class.php on line 120

Is there anything I can do about this so I can use Snapshot?

  • Patrick
    • Support Monkey

    Hi again @doug_mouncey

    Then that would likely mean that your host has disabled that function. You would need to do one of the following:

    a) Remove the php_uname string from disable_functions in your php.ini file (you can ask your host to remove the string above if you don’t have access to php.ini)

    b) Change hosting provider which allows the running of the php_uname function.

    Hope this helps! And thanks for being a member :slight_smile:

  • Paul
    • The Green Incsub

    @doug_mouncey,

    So that function is used by the AWS library to communicate with Amazon/AWS. This PHP library is provided as a pluggable module and not really written by us.

    Did some research and found out the function is not critical. It basically is used to gather information about your site when connecting to the AWS server.

    So to solve this you have a couple of solutions.

    1. Follow the excellent advice from Patrick on enabling php_uname in your php.ini. But I’m guessing you hosting will prevent this. I’ve seen some hosts compile a special PHP build so the php.ini has no effect.

    2. I noticed this is a Warning. Which tells me you have your error_reporting set such that warnings are displayed to the screen. So I find it funny that a hosting company would turn off php_uname but allow error_reporting for warnings. Hack error_reporting can provide all sorts of savory information about the hosting. More than php_uname would in fact. So best thing is to turn off error_reporting. First check your WP_DEBUG in your site’s wp_config.php http://codex.wordpress.org/Editing_wp-config.php#Debug Also you want to double check your php.ini (if available to you) and make sure error_reporting ( http://php.net/manual/en/function.error-reporting.php) and display_errors ( http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors ) is set such that warnings and notices are NOT displayed.

    3. If all this fails then what I would do is edit the functions.php file of my current theme. In the functions.php just add a stub function to sort of trick the AWS library that it has a valid function. Something like

    if (!function_exists('php_uname')) {
    function php_uname() {
    return false;
    }
    }

  • Paul
    • The Green Incsub

    @doug_mouncey,

    I just wanted to add that my #3 suggestion will not work. I actually tried this setup on my local development system. Seems there is a php.ini parameter ‘disable_functions’ where the admin can disable certain functions from being called. But this does not remove them from PHP scope. The main php_uname() function is still called.

    So this morning I patched some of the Snapshot code to maybe lessen the warnings or at least keep Snapshot from just aborting. so when you get a chance upgrade to Snapshot 2.3.3

    One addition I need to pass on to you is a change in the Snapshot settings. If you go to Snapshots > Settings you will see a section (near the bottom) for Error Reporting. The first column controls when to abort processing. Make sure you don’t have the Warnings or Notices checked. So only Errors. This will tell Snapshot to keep going.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.