WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Auto-Update Failure in WordPress 2.7 (26 posts)

  1. penfil
    Member
    Posted 5 years ago #

    I just upgraded to WordPress 2.7 and everything seems to be working smoothly, except the auto-update feature.

    I tried to upgrade a plugin automatically and after entering the correct FTP info I get the following error message:

    Warning: ftp_rawlist(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php on line 203
    Warning: ftp_rawlist(): Unable to create temporary file. Check permissions in temporary files directory. in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php on line 203
    
    Unable to locate WordPress Plugin directory.
    
    Plugin upgrade Failed

    This happens with any plugin that is already installed and I try to upgrade. It also happens if I try to install a new plugin through WordPress.

    I tried adding the define function to the config file as one of the bug fixes from 2.7 RC1 and RC2 recommended, but it didn't help.

    The site I am working with is hosted by AllDomains and they are not very client friendly. (I don't recommend them). I am almost sure I do am not allowed access to php.ini unless there is some way to bypass it.

    Can anyone help me fix this?

  2. Samuel B
    moderator
    Posted 5 years ago #

    add this to wp-config.php

    define('WP_TEMP_DIR','/tmp');
    should work

    if not, replace it with
    define('WP_TEMP_DIR', ini_get('upload_tmp_dir'));

  3. penfil
    Member
    Posted 5 years ago #

    @samboll

    I already tried the second function you listed:
    define('WP_TEMP_DIR', ini_get('upload_tmp_dir'));

    The results are listed in my original post.

    As for the first command you suggested:
    define('WP_TEMP_DIR','/tmp');

    I get even more errors, as follows:

    Warning: touch(): open_basedir restriction in effect. File(/tmp/1233258421) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/file.php on line 174
    Warning: fileowner(): open_basedir restriction in effect. File(/tmp/1233258421) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/file.php on line 628
    Warning: unlink(): open_basedir restriction in effect. File(/tmp/1233258421) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/file.php on line 630
    Warning: touch(): open_basedir restriction in effect. File(/tmp/1233258421) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/file.php on line 174
    Warning: fileowner(): open_basedir restriction in effect. File(/tmp/1233258421) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/file.php on line 628
    Warning: unlink(): open_basedir restriction in effect. File(/tmp/1233258421) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/file.php on line 630 
    
    AND
    
    Warning: ftp_rawlist(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/usr/local/pem/vhosts/154599) in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php on line 203
    Warning: ftp_rawlist(): Unable to create temporary file. Check permissions in temporary files directory. in /usr/local/pem/vhosts/154599/webspace/httpdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php on line 203

    And yes, I did go as far as to create the tmp directory and give it the appropriate permissions.

    I think the problem is that the webhost (AllDomains) did not properly set up a tmp dir for this account, or something in the php.ini is wrong... But I don't know how to fix it... or bypass it...

    Any other suggestions? Anyone?

  4. Samuel B
    moderator
    Posted 5 years ago #

    or they really have the restriction in effect
    ask them - your host

  5. penfil
    Member
    Posted 5 years ago #

    @samboll - Are you kidding me?! I have called them before... Several times... They will not help with anything that is not specifically included with their "scripts" package. Since I installed WordPress 2.7 on my own (since they don't offer it), they will not help with anything.

    They had a server problem with .htaccess files and I called about that and I had to call 3 times just to speak to a manager so he would "look into it" and miraculously it was fixed the same hour (without any admission of fault on their part).

    Isn't there some other way I can get the auto-update to work without using the php.ini defined temp directory? Even if it requires hacking a few additional WP files... I can handle that... Just need to know what I'm looking for.

  6. Samuel B
    moderator
    Posted 5 years ago #

  7. penfil
    Member
    Posted 5 years ago #

    @samboll - Thank you for the link. I read it and it all makes much more sense now. It looks like unless I can find a work around, I'm just out of luck. This webhost is really not very friendly or helpful.

    Thanks again.

    If anyone knows a way around this, I'd be happy to know. Meanwhile I'll be wasting my time on the phone with a tech support who pretty much refuses to budge.

  8. Mark
    Member
    Posted 5 years ago #

    You could do what I do: Pretend the auto-upgrade feature was never added. It's broken on a mega-ton of Web hosting sites and it's broken if you implement strong file permissions security on your site.

    Better to manually handle upgrades. For now anyway. Until somebody gets the idea to fix the WP upgrade code so that it actually tests for compatibility FIRST before proceeding to break stuff and generate a lot of support requests....

  9. penfil
    Member
    Posted 5 years ago #

    @wpsec - You make a great point. I guess I don't have much else of an option at this point. I guess I was just getting spoiled with that feature when updating some other peoples blogs for them... manual it is.

    If they tested for compatibility first as you mentioned, at least then they could allow a link to the actual plugin repository page for the plugin in need of an upgrade. Have to go search for it manually to download it now, can't even click on the link to it as it's only setup for the auto-update.

    Well thanks for your help.

  10. penfil
    Member
    Posted 5 years ago #

    I'm going to mark this "resolved" even though the problem really isn't resolved... Not much the community can do to help at this point, so no sense in keeping this in limbo.

    Thanks guys for all your help.

  11. lightwolf
    Member
    Posted 5 years ago #

    I had a quick google around, and the culprit seems to be the php function ftp_rawlist() which in turn ignores WP_TEMP_DIR completely.

    Here is my workaround:
    putenv('TMPDIR=' . ini_get('upload_tmp_dir'));
    Added to wp-config.php.

    It seems to work, I got updates to finally work.

    Cheers,
    Mike

  12. Mark
    Member
    Posted 5 years ago #

    Thanks lightwolf, that saved me a lot of headaches!

  13. David Klhufek
    Member
    Posted 5 years ago #

    Thanks guys for all your help. Special to lightwolf. That's tip working for me fine now:)

  14. blackevelvet
    Member
    Posted 5 years ago #

    Thanks Lightwolf! It worked for me:)

  15. cezarneaga
    Member
    Posted 5 years ago #

    i still get this
    Warning: ftp_rawlist() [function.ftp-rawlist]: Unable to create temporary file. Check permissions in temporary files directory. in /is/htdocs/wp1090696_F7DLCX6X2Y/www/wp-admin/includes/class-wp-filesystem-ftpext.php on line 203 even after Lightwolf's hack.

    any ideas?
    thanks.
    c

  16. apronstringsaflutter
    Member
    Posted 5 years ago #

    Thanks Lightwolf...you saved me some time and bald spots...

  17. quinze
    Member
    Posted 5 years ago #

    Create a /tmp directory in your web directory, chmod it to 777 and refer to it in the following function.

    putenv('TMPDIR=/path/to/my/web/hosting/directory/www/tmp/');

    Put this in your wp-config.php

    For cezarneaga it could be something like

    putenv('TMPDIR=/is/htdocs/wp1090696_F7DLCX6X2Y/www/tmp/');

  18. Lutvi Avandi
    Member
    Posted 4 years ago #

    It is doesn't work in byethost

  19. Skeskali
    Member
    Posted 4 years ago #

    I tried the fix outlined above (adding the line to wp-config) and suddenly WP couldn't find my wp-content directory! EEP.

  20. narlysoftware
    Member
    Posted 4 years ago #

    I also added the line and successfully upgraded all in one seo pack. From that point on WP could not find the wp-content directory!!!

    There is a flaw in the WP code. Has anybody worked thru this???

    Help....

  21. wikinerd
    Member
    Posted 4 years ago #

    Doesn't work in Byethost. Anyone has a workaround? (manually upgrading all the plugins as well as the installation can get tiresome..)

  22. narg
    Member
    Posted 4 years ago #

    I dont know why but in file wp-admin/inclides/file.php
    On line aprox 144
    The function get_temp_dir totally ignores WP_TEMP_DIR
    So my correction passes by change

    return '/tmp/';
    }

    To

    return '/directory/to/tmp';
    }
  23. mcarretero
    Member
    Posted 4 years ago #

    Hello everybody!

    I'm using WordPress 2.8.1 in ByetHost. I had the same problem with "Unable to locate WordPress Plugin directory." but I solved it by adding the following code in my wp-config.php:

    if(is_admin()) {
    	add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    	define( 'FS_CHMOD_DIR', 0751 );
    }

    I've just write a post in one of my blogs (a very new blog), but it's in spanish. May be you will can understand or, at least, be useful. You can see it here:
    SoluciĆ³n a los problemas FTP en WordPress 2.8
    .

    If you have any question, please leave it in my blog ;)

    Sorry for my English :S . I'm copying and pasting this post in part on other threads, sorry again.

  24. Remkus de Vries
    Member
    Posted 4 years ago #

    In my case non of the above worked, but what did work was instead of typing in the url in the ftp field, I used the server's local address: 127.0.0.1 and everything worked like a charm again.

    Hope this helps someone else too :)

  25. sobigfish
    Member
    Posted 4 years ago #

    doc_root is like this /home/vol11/gofreeserve.com/gofre_number/domain.com/htdocs in gofreeserve.com
    ftp dir is /domain.com/htdocs/

    So I put define('FTP_BASE', /domain.com/htdocs/'); into config file.
    still get Unable to locate WordPress Content directory (wp-content)

    class-wp-filesystem-base.php is a funny joke at all.

  26. Jehy
    Member
    Posted 4 years ago #

    I had the same problem :)

    This worked fine for me, it's the simplest method to cure /tmp directory bug...

Topic Closed

This topic has been closed to new replies.

About this Topic