PHP Warning: touch(): Utime failed: Operation not permitted

Home Forums BulletProof Security Pro PHP Warning: touch(): Utime failed: Operation not permitted

This topic contains 5 replies, has 2 voices, and was last updated by  AITpro Admin 2 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #27855

    Samm
    Participant

    I have recently upgraded php 5.4 to php 5.5 and MySQL 5.5 to 5.6.  Since then, when I reset the last modified time in DB for the PHP Error log, I am getting the following:

    [BPS Pro htaccess Protected Secure PHP Error Log]

    [20-Jan-2016 17:29:13 UTC] PHP Warning:  touch(): Utime failed: Operation not permitted in /xxx/xxx/Xxx/xxx/xxxx/public_html/xxx/wp-content/plugins/bulletproof-security/admin/php/php-options.php on line 1602

    This only happens to the PHP Error log and not to the Security log.

    This is happening on all of my WordPress sites on this server.  I have reset permissions on all files and folders, as I initially thought this might be a permissions error.  I have not seen this issue before the PHP/MySQL upgrade.  Any idea what could cause this?

    Thanks.

    #27858

    AITpro Admin
    Keymaster

    Most likely the cause of the problem is a file permission or Ownership problem.
    http://stackoverflow.com/questions/1676743/why-would-file-put-contents-succeed-but-touch-fail

    Go to the BPS System Info page and copy your System Info and post this information below in your forum reply:

    Server Type:
    Operating System:
    WP Filesystem API Method:
    Server API:

    Copy and paste everything from the: File|Folder Permissions (CGI or DSO)|Script Owner User ID (UID)|File Owner User ID box.

    #27862

    Samm
    Participant

    Server Type:  Apache/2.2.22 (Debian)
    Operating System:  Linux
    WP Filesystem API Method:  direct
    Server API:  apache2handler DSO Host Server Type

    DSO File and Folder Permissions|Recommendations
    File Path
    Folder Path    Recommended
    Permissions    Current
    Permissions    Script Owner
    User ID (UID)    File Owner
    User ID
    ../    755    0775    1041    1041
    ../.htaccess    644    0664    1041    1041
    ../wp-config.php    644    0664    1041    1041
    ../index.php    644    0664    1041    1041
    ../wp-blog-header.php    644    0664    1041    1041
    ../wp-admin    755    0775    1041    1041
    ../wp-includes    755    0775    1041    1041
    ../wp-content    755    0775    1041    1041
    ../wp-content/plugins    755    0775    1041    1041
    ../wp-content/themes    755    0775    1041    1041
    ../wp-content/uploads    755    0775    1041    1041
    ../wp-content/upgrade    755    0775    1041    1041
    ../wp-content/bps-backup    755    0775    1041    1041
    ../wp-content/bps-backup/autorestore    755    0775    1041    1041
    ../wp-content/bps-backup/logs    755    0775    1041    1041
    ../wp-content/bps-backup/master-backups    755    0775    1041    1041
    ../wp-content/bps-backup/quarantine    755    0775    1041    1041
    ../wp-content/bps-backup/backups_hxSdnrpOiYHQ3kP    755    0775    1041    1041

    I also noticed the following on this page.  Could any of  this be a problem, also?
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    : mod_access_compat is NOT Loaded|Order, Allow, Deny directives are NOT supported
    mod_authz_core is NOT Loaded
    mod_authz_host is NOT Loaded

    #27866

    AITpro Admin
    Keymaster

    Hmm I don’t think 775 permissions are safe to use and may be the cause of this problem.  See this post about that:  http://serverfault.com/questions/144194/is-chmod-775-safe-to-use  So what I would try first is to change all your folder permissions to 755 recursively, which means apply folder permissions to all of your website’s folders at the same time and is usually a checkbox option in an FTP application like WinSCP or FileZilla.

    And yes the ERROR: wp_remote_get() function is blocked or unable to get the URL path is the same type of permission or Ownership problem or it can be caused by using some code in your wp-config.php file that alters the default folder paths for WP and is incorrectly configured.

    #27889

    Samm
    Participant

    I have tracked down and fixed the “wp_remote_get() function is blocked or unable to get the URL path” error.

    My hosts default file permissions is set to 775 for folders and 664 for files.  I do not think that this should be a problem, as it was not a problem before upgrading php/mysql recently.  My host also does not make it possible to change these file permissions via FTP.

    #27890

    AITpro Admin
    Keymaster

    Oh by the way you stated that the error occurs when “…when I reset the last modified time in DB for the PHP Error log…”.  The code in this file at code line:  php-options.php on line 1602 is for the Delete Log button, which deletes the PHP error log file.  In any case I don’t think this particular error is that important, but the PHP touch() function is used in other places in the BPS Pro plugin code and those uses of touch() are important.  So at this point we can assume that some restriction on your particular server is definitely blocking the php touch() function for deleting the php error log file, which is in this folder:  /wp-content/bps-backup/logs/ and it is unknown at this time whether or not all instances of php touch() functions will be affected/blocked/restricted in other BPS Pro plugin files and if it will be affected/blocked/restricted by your server.  So when you upgrade to BPS Pro 11.6, which should be released soon then check your PHP error log for any other php errors that are related to the php touch() function and post them here if you see any.  If you do not see any other php touch() function php errors then the problem on your server is isolated to this folder:  /wp-content/bps-backup/logs/

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.