• lernerconsulting

    (@lernerconsult)


    Many people get the backup folder wrong, and then ask for support. The problem often shows up as Zip file errors.

    I suggest a notice “temp folder can not be written to”, “backup file can not be written to”, “log file…”

    I suggest adding to the (unredacted version of the) log, “Suggested backup folder: /user/USERNAME/backups/ based on your WordPress installation folder /user/USERNAME/public_html/ “

    Here’s PHP I use:

    /* Determine where to log errors. Important to have server (.htaccess) security prevent outsiders reading the error log file, or to put it in a folder above public_html */
    if (!function_exists('posix_getpwuid') ) {
    	/* default Xampp doesn't have posix_getpwuid(), which is for shared hosting */
    	/* LunarPages sets PHPRC */
    	/* SiteGround doesn't set PHPRC */
    
    	if (getenv("PHPRC") !== false ) {
    		/* testing !getenv doesn't work??? testing against false works */
    		/* set to the hosting account main site's document root (e.g. public_html ) */
    		$logFolder = getenv("PHPRC");
    	} else {
    		/* set to the web site root, each site will have an error_log */
    		$logFolder = $docroot;
    	}
    } else {
    	/* set to the hosting account root, e.g. the folder that contains public_html */
    	$userInfo = posix_getpwuid(posix_getuid());
    	/* Array
    	(
    		[name] => _______
    		[passwd] => x
    		[uid] => 32509
    		[gid] => 32511
    		[gecos] =>
    		[dir] => /home/______
    		[shell] => /usr/local/cpanel/bin/noshell
    	)
    	*/
    	$logFolder = $userInfo["dir"];
    }
    $logFile = $logFolder."/error_log";
    
    if (isset($_SERVER['SERVER_SOFTWARE']) && (strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) !== FALSE) ) {
    	$logFile = $docroot."/error_log";
    }

    https://www.ads-software.com/plugins/backwpup/

Viewing 1 replies (of 1 total)
  • Daniel Hüsken

    (@danielhuesken)

    Hello George,

    the messages that you are suggest are already implemented. We use the uploads folder with .htaccess for all folder because there are mostly, the rights so set, we can write files in the folder.

Viewing 1 replies (of 1 total)
  • The topic ‘Suggest backup folder’ is closed to new replies.