With WordPress 2.7 I still have problems to do a core update, installing plugins with the automatic update procedure or even update existing plugins. I’m getting an error like this:
“WordPress updateWarning: ftp_rawlist() [function.ftp-rawlist]: Unable to create temporary file. Check permissions in temporary files directory. in /is/htdocs/your_path_to_wp/wp-admin/includes/class-wp-filesystem-ftpext.php on line 200.
Unable to locate WordPress directory.”
On many Blogs you can find a so called solution
“Edit the file.php and search for “if ( getmyuid() == fileowner($temp_file) )” and replace “if ( getmyuid() == fileowner($temp_file) )” with “if ( posix_getuid() == fileowner($temp_file) )”, save and upload and it works…”
Be careful!
This is not a fix this is a quick and dirty break. Leave the file.php untouched and try a real solution. Why is it quick and dirty? First of all after a core update your hack is gone and you have to investigate your time again. On the other hand it only works if your WP is on a linux web server and you might loose the permissions to files and folder updated with the quick and dirty solution.
Please follow up with a solution that really helps you out and work:
Before getting to the solution first have a look at your wp-config-php:
You can add this line to give a specific folder for uploading and working:
define(’WP_TEMP_DIR’, ‘/is/htdocs/your_path_to_wp/temp/’);
verify that the folder exists and has appropiate rights, this depends on your provider. You also can add these lines to set up with which rights WP will generate the new files and folders:
define(’FS_CHMOD_FILE’,644);
define(’FS_CHMOD_DIR’,755);
These two or three settings is not to solve the problem, just to show that there are more options that you can use to make WP run and gives you more control.
Now here is the real solution to our problem:
You need to create two new folder at your plugin folder at your web server and add the following code into a php-file like this:
Plugin 1:
Save this code into a file called force-ftp-ext.php and upload it into a folder beneath your plugin folder for example: plugins/useextftp
<?php
/*
Plugin Name: Force FTP Extension for WP Filesystem
Version: 1.0
Plugin URI: http://dd32.id.au/wordpress-plugins/?force-ftp
Description: Forces the WP_Filesystem to utilise the FTP Extension library.
Author: Dion Hulse
Author URI: http://dd32.id.au/
*/add_filter(‘filesystem_method’, ‘force_ftp’);
function force_ftp($method) {
return ‘ftpext’;
}
?>
as this plugin will not work on all web servers depending on their configurations try the second plugin (for me the 2nd method is the one that works for me!):
Plugin 2:
Save this code into a file called force-ftp-sockets.php and upload it into a folder beneath your plugin folder for example: plugins/usesocketftp
<?php
/*
Plugin Name: Force FTP Sockets for WP Filesystem
Version: 1.0
Plugin URI: http://dd32.id.au/wordpress-plugins/?force-ftp-sockets
Description: Forces the WP_Filesystem to utilise the FTP Sockets library.
Author: Dion Hulse
Author URI: http://dd32.id.au/
*/add_filter(‘filesystem_method’, ‘force_ftp_sockets’);
function force_ftp_sockets($method) {
return ‘ftpsockets’;
}
?>
Depending on the web server or provider settings you have to activate simply ONE of the plugins – do not activate both at the same time! The last plugin needs the FTP Sockets Library to be installed.
You have to try if plugin 1 or plugin 2 works for you, you can wait until someone updates a plugin or simply try to install a new plugin with the built in plugin installer of WP 2.7.
Both plugins are experimental and not an official release but I found they should be published. They come with no warranty and you will use them on your own risk.
The author of the plugins is DD32 and the website can be found here: http://dd32.id.au
Have fun and good look with this solution…

