• Resolved mitchbnj

    (@mitchbnj)


    OK:
    Here’s my question:
    I tried to update my jetpack (as well as the akismet plug in below)

    one response said error was in wp-admin/wp-config.php file, and to ensure it’s right and add the directory pointers as suggested.
    HOWEVER, the error message (again after the ===_
    says the error is in line 1092 (here)
    I quote… No such file or directory in /home/customer/www/azadminsolutions.com/public_html/wp-admin/includes/file.php on line 1092

    But real problem is when I get there in that file, at that line I see a subroutine

    I get the same messages for any plug ins I try to update.
    the message(s) I received are after line with “===”

    I searched google for
    various things like “Fix WordPress ‘Destination directory for file streaming does not exist or is not writable”
    ** this site (https://www.dessol.com/blog/fix-wordpress-destination-directory-for-file-streaming-does-not-exist-or-is-not-writable/) said it’s likely a permissions problem, or missing a tmp directory.
    but looking closer, it seems

    ============================
    Update Plugin

    Downloading update from https://downloads.wordpress.org/plugin/akismet.4.1.9.zip…

    Warning: unlink(/home/customer/www/azadminsolutions.com/public_htmlwp-content/uploads/akismet.4.1.9-dAXXIP.tmp): No such file or directory in /home/customer/www/azadminsolutions.com/public_html/wp-admin/includes/file.php on line 1092

    Download failed. Destination directory for file streaming does not exist or is not writable.

    =================
    End error msg

    OK: so how do I determine why I’m having these update issues.
    it does turn out that there were other issues related to the sites’s hosting and move of the site, mostly because there were permission problems with certain directories.
    Is there a suggested list of directories and permissions anywhere easily accessible?

    code snippet from my wp-admin/includes/file.php around error location

    **************code snipet from file.php on my site:
    starts at line 1053
    line 1053: `/**
    * Downloads a URL to a local temporary file using the WordPress HTTP API.
    *
    * Please note that the calling function must unlink() the file.
    *
    * @since 2.5.0
    * @since 5.2.0 Signature Verification with SoftFail was added.
    *
    * @param string $url The URL of the file to download.
    * @param int $timeout The timeout for the request to download the file.
    * Default 300 seconds.
    * @param bool $signature_verification Whether to perform Signature Verification.
    * Default false.
    * @return string|WP_Error Filename on success, WP_Error on failure.
    */
    function download_url( $url, $timeout = 300, $signature_verification = false ) {
    // WARNING: The file is not automatically deleted, the script must unlink() the file.
    if ( ! $url ) {
    return new WP_Error( ‘http_no_url’, __( ‘Invalid URL Provided.’ ) );
    }

    $url_filename = basename( parse_url( $url, PHP_URL_PATH ) );

    $tmpfname = wp_tempnam( $url_filename );
    if ( ! $tmpfname ) {
    return new WP_Error( ‘http_no_file’, __( ‘Could not create Temporary file.’ ) );
    }

    $response = wp_safe_remote_get(
    $url,
    array(
    ‘timeout’ => $timeout,
    ‘stream’ => true,
    ‘filename’ => $tmpfname,
    )
    );

    if ( is_wp_error( $response ) ) {
    unlink( $tmpfname );
    return $response;
    }

    $response_code = wp_remote_retrieve_response_code( $response );

    if ( 200 != $response_code ) {
    $data = array(
    ‘code’ => $response_code,
    );

    // Retrieve a sample of the response body for debugging purposes.
    $tmpf = fopen( $tmpfname, ‘rb’ );
    if ( $tmpf ) {
    /**
    * Filters the maximum error response body size in download_url().
    *
    * @since 5.1.0
    *
    * @see download_url()
    *
    * @param int $size The maximum error response body size. Default 1 KB.
    */
    $response_size = apply_filters( ‘download_url_error_max_body_size’, KB_IN_BYTES );
    $data[‘body’] = fread( $tmpf, $response_size );
    fclose( $tmpf );
    }

    unlink( $tmpfname );
    return new WP_Error( ‘http_404’, trim( wp_remote_retrieve_response_message( $response ) ), $data );
    }

    $content_md5 = wp_remote_retrieve_header( $response, ‘content-md5’ );
    if ( $content_md5 ) {
    $md5_check = verify_file_md5( $tmpfname, $content_md5 );
    if ( is_wp_error( $md5_check ) ) {
    unlink( $tmpfname );
    return $md5_check;
    }
    }

    // If the caller expects signature verification to occur, check to see if this URL supports it.
    if ( $signature_verification ) {
    /**
    * Filters the list of hosts which should have Signature Verification attempted on.
    *
    * @since 5.2.0
    *
    * @param string[] $hostnames List of hostnames.
    */
    $signed_hostnames = apply_filters( ‘wp_signature_hosts’, array( ‘wordpress.org’, ‘downloads.wordpress.org’, ‘s.w.org’ ) );
    $signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true );
    }

    // Perform signature valiation if supported.
    if ( $signature_verification ) {
    $signature = wp_remote_retrieve_header( $response, ‘x-content-signature’ );
    if ( ! $signature ) {
    // Retrieve signatures from a file if the header wasn’t included.
    // WordPress.org stores signatures at $package_url.sig.

    $signature_url = false;
    $url_path = parse_url( $url, PHP_URL_PATH );

    if ( ‘.zip’ === substr( $url_path, -4 ) || ‘.tar.gz’ === substr( $url_path, -7 ) ) {
    $signature_url = str_replace( $url_path, $url_path . ‘.sig’, $url );
    }

    /**
    * Filters the URL where the signature for a file is located.
    *
    * @since 5.2.0
    *
    * @param false|string $signature_url The URL where signatures can be found for a file, or false if none are known.
    * @param string $url The URL being verified.
    */
    $signature_url = apply_filters( ‘wp_signature_url’, $signature_url, $url );

    if ( $signature_url ) {
    $signature_request = wp_safe_remote_get(
    $signature_url,
    array(
    ‘limit_response_size’ => 10 * KB_IN_BYTES, // 10KB should be large enough for quite a few signatures.
    )
    );

    if ( ! is_wp_error( $signature_request ) && 200 === wp_remote_retrieve_response_code( $signature_request ) ) {
    $signature = explode( “\n”, wp_remote_retrieve_body( $signature_request ) );
    }
    }
    }

    // Perform the checks.
    $signature_verification = verify_file_signature( $tmpfname, $signature, basename( parse_url( $url, PHP_URL_PATH ) ) );
    }

    if ( is_wp_error( $signature_verification ) ) {
    if (
    /**
    * Filters whether Signature Verification failures should be allowed to soft fail.
    *
    * WARNING: This may be removed from a future release.
    *
    * @since 5.2.0
    *
    * @param bool $signature_softfail If a softfail is allowed.
    * @param string $url The url being accessed.
    */
    apply_filters( ‘wp_signature_softfail’, true, $url )
    ) {
    $signature_verification->add_data( $tmpfname, ‘softfail-filename’ );
    } else {
    // Hard-fail.
    unlink( $tmpfname );
    }

    return $signature_verification;
    }

    return $tmpfname;
    }`
    ends line 1213
    **************end of code snipet 1 from file.php on my site:

    From what I can see (you can search for this above: this is line where 1092 ends (included from line 1054 to line 1094)

    **************Start of code snipet 2 from file.php on my site: (lines 1054 to 1094) error was at 1092)
    line 1092 which is where msg says error is: ” unlink( $tmpfname );” (quotes mine)
    — line 1054

    /**
     * Downloads a URL to a local temporary file using the WordPress HTTP API.
     *
     * Please note that the calling function must unlink() the file.
     *
     * @since 2.5.0
     * @since 5.2.0 Signature Verification with SoftFail was added.
     *
     * @param string $url                    The URL of the file to download.
     * @param int    $timeout                The timeout for the request to download the file.
     *                                       Default 300 seconds.
     * @param bool   $signature_verification Whether to perform Signature Verification.
     *                                       Default false.
     * @return string|WP_Error Filename on success, WP_Error on failure.
     */
    function download_url( $url, $timeout = 300, $signature_verification = false ) {
    	// WARNING: The file is not automatically deleted, the script must unlink() the file.
    	if ( ! $url ) {
    		return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
    	}
    
    	$url_filename = basename( parse_url( $url, PHP_URL_PATH ) );
    
    	$tmpfname = wp_tempnam( $url_filename );
    	if ( ! $tmpfname ) {
    		return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.' ) );
    	}
    
    	$response = wp_safe_remote_get(
    		$url,
    		array(
    			'timeout'  => $timeout,
    			'stream'   => true,
    			'filename' => $tmpfname,
    		)
    	);
    
    	if ( is_wp_error( $response ) ) {
    		unlink( $tmpfname );
    		return $response;
    	}

    ** line 1094
    **************end of code snipet 2 from file.php on my site:

    I hope i’ve given enough info to try and resolve this issue.

    from what appears in the file.php, I think this is a wordpress main issue. but we’re currently fully updaated.

    oh yeah
    last (obvious) clue.
    I can see (I’m oblivious, but not totally!) that the error message has the following error that is parsed in it, but not sure where error is actully coming from…
    the error message comes up saying. “Warning: unlink(/home/customer/www/azadminsolutions.com/public_htmlwp-content/uploads )
    where /www/azadminsolutions.com/public_htmlwp-content/ is OBVIOUSLY missing a slash between public_html annd wp-content.

    Where the heck is the missing slash supposed to come from? simple, yet not so simple…

    Anxiously awaiting some help figuring out where the error is.

    Thanks again!

Viewing 5 replies - 1 through 5 (of 5 total)
  • check your hosting account disk quota, is it full?
    ask your hosting provider to check the server /tmp directory, is it full?

    Thread Starter mitchbnj

    (@mitchbnj)

    No. THIS suggestion did not work. I have plenty of space. this error occurs on my host’s system, as well on my local (pc winampserver 3.2.3) copy of the system.

    sorry for the 4 month delay. Life unfortunately sometimes interfers.
    To the moderator: didn’t even remember posting, as I apparently didn’t get any messages before–sorry:

    I did find (and follow up with a new post (now closed) that I am re-posting it here.

    This IS a problem with the locations that WordPress is using.

    `===================
    WordPress Troubleshooting problem — more info. and less info:

    Summary (Details below)
    =======================
    Live web-site had errors in updating.

    several problems, mostly due to file permissions and directory errors

    ———-> bottom line question:

    Can someone help me find out where all of the file permissions and directories need to be updated on a site?

    I’ve found one php file in WordPress that seems to have the majority of answers.
    ==========================VVVVVVVVVVVVVVVVVVVVVVVVVVVVV==============================
    That would be by running the /wp-admin/options.php file and looking for ‘path’ and ‘url’ and updating manually.

    BUT..

    ——-> I believe I am missing one spot that has additional directory locations.

    ===========================> MY question #1 <————

    <blockquote>Can someone help me find out where all of the directories need to be updated on a site?</blockquote>

    I am trying to find out where I need to make changes to get working.
    —————-Details below———————–

    Original problem:
    after migrating from different host, (static) wordpress site was fine, and then developed a problem where couldn’t update a page, because couldn’t upload jpg. (Host found problem with permissions), didnt tell me where…

    system finally resolved by host company, after level 3 escalation.

    eventually new problem came up, and problem same as before, but couldn’t upload.

    I did a copy of the website down to my local pc winampserver. THAT means it’s not HOSTING related.
    And since it’s affecting all my themes and plug in’s it’s NOT a plugin/theme issue,thus my posting here

    I finally found a problem that the /wp-admin/options.php file had the following value:

    ON my LOCAl HOST: (file originally from live site)
    in options.php:
    fileupload_url = http://localhost/example/home/admin/domains/testing.installatron.com/public_html/djfkl/wp-content/uploads
    also in options.php
    upload_path = http:///example.com/public_html/wp-content/uploads

    In other words, in my production site, I found the path (from an installatron install) messing up with stuff

    where else besides wp-admin/options.php do I need to make directory changes in???

    thanks
    —————–end details————————-

    Better yet, what/where are the error logs, what level should I turn on, and what should I look for? still not running.

    • This reply was modified 4 years, 9 months ago by mitchbnj. Reason: pretty-ing
    • This reply was modified 4 years, 9 months ago by mitchbnj.
    • This reply was modified 4 years, 9 months ago by mitchbnj.
    • This reply was modified 4 years, 9 months ago by mitchbnj.
    • This reply was modified 4 years, 9 months ago by mitchbnj.
    • This reply was modified 4 years, 9 months ago by mitchbnj. Reason: formatting again
    Thread Starter mitchbnj

    (@mitchbnj)

    I am STILL having major problems in fixing my upload files.

    I tried loading the wp-options.php file and changing file location names
    where it said path, and url-path.

    Still getting errors and cant update anything.

    MY original question was based on a file not having access.

    Please help me by telling me what files I need to edit to make sure that
    * my default upload paths of …/wp-content/uploads will be taken as is.
    * my default url path of …/wp-content/uploads will also be clean.

    *** do I need to remove something from my config file?? ***

    Thread Starter mitchbnj

    (@mitchbnj)

    I am going to close out this thread, and repost parts of it as a new query.

    Because the original question was asked 4 months ago, perhaps someone missed my original and perhaps no one has understood my real question:
    ====>>
    I can no longer update parts of the website (plugins and themes).

    I have tried loading the wp-options.php file and changing file location names
    where it said path, and url-path. When I do this, I get the default ‘enter language’ startup for new installs.
    +++++++++++++> to me this means, that besides the wp-options.php file, there must be at least one other place(s) where the path is set incorrectly.

    ==========================< Is this question clear enough? or does it need to be restated? >———————–

    —> new link to this discussion: —->

    Thread Starter mitchbnj

    (@mitchbnj)

    Closing. Please see newly posted question (search for my name!)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘error updating plugin (any) not exist or writable’ is closed to new replies.