Forums

WordPress SEO by Yoast
Error when trying to export settings (16 posts)

  1. DocEastin
    Member
    Posted 10 months ago #

    I just finished the setup for SEO and tried to export my settings. When I did, I got the following error message:

    Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/ceastin/public_html/www.IdahoNaturalDentist.com/wp-content/plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 90

    Anyone ever run into something similar? BTW, I'm a dentist, not a wordpress expert:)

    Thanks!

  2. kizora
    Member
    Posted 10 months ago #

    Yes, I've just got the same error on my website.

  3. Scott Hendison
    Member
    Posted 10 months ago #

    We ONLY get the word "Error:" and no more details - however - no dialogue box opens to download the settings. After the first one failed i found this post - then tried on two more sites on other servers and get same result. No error details - just blank - and no way to download settings.zip...

  4. Scott Hendison
    Member
    Posted 10 months ago #

    PS - Two of the sites were WP3.20 and one 3.21

  5. g5fzvo
    Member
    Posted 10 months ago #

    Yes, I'm getting the same thing on several WP blogs. Weird. I'd love to be able to move my settings around once optimized on one blog.

    Exact error:

    Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/bcrhodes/public_html/blogboxster.com/foundation/wp-content/plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 90

    Anyone know of a fix for this?

    Thanks.

    - Brett

  6. llester
    Member
    Posted 10 months ago #

    I just want to add my "vote" to this bug report. Sure hope it gets fixed, because I have a bunch of sites I'd like to use this with and no desire to have to go through the whole process for each.

    Lane

  7. Aspired Muse
    Member
    Posted 10 months ago #

    Also experiencing the same issue. Exporting worked fine last month. Hoping for a very quick fix.

  8. trimark
    Member
    Posted 10 months ago #

    I apologize for being a PHP hack, but the problem seems to be

    Notice: Use of undefined constant WPSEO_UPLOAD_DIR - assumed 'WPSEO_UPLOAD_DIR' in plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 79

    Notice: Use of undefined constant WPSEO_UPLOAD_DIR - assumed 'WPSEO_UPLOAD_DIR' in plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 88

    Warning: chdir() [function.chdir]: No such file or directory (errno 2) in plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 88

    If someone has some input, I'd luv to have an answer

  9. crisherent
    Member
    Posted 10 months ago #

    Also experiencing the same issue.

  10. Tony Hunt
    Member
    Posted 10 months ago #

    Hi Joost,

    Heh. I didn't feel the impact of this feature being broken until today when I had to update ALL my sites.

    So essentially this is hit me 15x today ;)

    No hurries as today was the first time it would have helped, and I do want to thank you for this suite because it give me just enough direct influence to make the sites play ball properly.

    Looking forward to seeing this out of beta!

    -Tony

  11. setuptips
    Member
    Posted 9 months ago #

    There is a subtitle difference in that the dir must be an OS path when creating the file and a url when returning the file for download.
    There should also be a leading / on settings.ini and settings.zip

    Here is my workaround. Try out at your own risk.
    NOTE: I have not tested the resulting import yet.

    Additions market with > starting from line 80. Mods marked with |

    > $upload_dir = wp_upload_dir();
    > $wpseo_upload_path = $upload_dir['path'];
    > $wpseo_upload_url = $upload_dir['url'];
    | if ( !$handle = fopen( $wpseo_upload_path.'/settings.ini', 'w' ) )
    die();

    if ( !fwrite($handle, $content) )
    die();

    fclose($handle);

    require_once (ABSPATH . 'wp-admin/includes/class-pclzip.php');

    | chdir($wpseo_upload_path);
    $zip = new PclZip('./settings.zip');
    if ($zip->create('./settings.ini') == 0)
    return false;

    | return $wpseo_upload_url.'/settings.zip';

  12. carolecross
    Member
    Posted 9 months ago #

    Thanks setuptips! It works and you rock!

  13. llester
    Member
    Posted 9 months ago #

    Yes! Both the export and the import now work. Thank you very much for that patch. It took me a little while to read back through the thread and pick up which file to edit, so I'll repeat that here:

    The patch applies to wordpress-seo/inc/wpseo-non-ajax-functions.php

  14. morcom
    Member
    Posted 9 months ago #

    Yes thank you so much setuptips
    Fantastic - works for me too - thanks

  15. Aspired Muse
    Member
    Posted 9 months ago #

    Unfortunately, this didn't work for me. I get the following error:

    Parse error: syntax error, unexpected T_EXIT in
    /plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 84 (last line)

    $upload_dir = wp_upload_dir();
    $wpseo_upload_path = $upload_dir['path'];
    $wpseo_upload_url = $upload_dir['url'];
    if ( !$handle = fopen( $wpseo_upload_path.'/settings.ini', 'w' ) )
    die();

    So what did I miss?

  16. devonwoods
    Member
    Posted 9 months ago #

    I found an even simpler solution that worked. Add the following lines to wp-seo.php:

    define( 'WPSEO_UPLOAD_DIR', plugin_dir_path(__FILE__) );
    define( 'WPSEO_UPLOAD_URL', plugin_dir_url(__FILE__) );

    Add them up top with the other 'define' declarations.

Reply

You must log in to post.

About this Plugin

About this Topic