chmod 777 $dir
If you post a message to the MU support forum at http://mu.wordpress.org/forums/ then copy and paste the following information into your message:
"; print ""; print ""; } function do_htaccess( $oldfilename, $newfilename, $realpath, $base, $url ) { // remove ending slash from $base and $url $htaccess = ''; if( substr($base, -1 ) == '/') { $base = substr($base, 0, -1); } if( substr($url, -1 ) == '/') { $url = substr($url, 0, -1); } $err = ''; if( is_file( $oldfilename ) ) { $fp = @fopen( $oldfilename, "r" ); if( $fp ) { while( !feof( $fp ) ) { $htaccess .= fgets( $fp, 4096 ); } fclose( $fp ); $htaccess = str_replace( "REALPATH", $realpath, $htaccess ); $htaccess = str_replace( "BASE", $base, $htaccess ); $htaccess = str_replace( "HOST", $url, $htaccess ); if( touch( $newfilename ) ) { $fp = fopen( $newfilename, "w" ); if( $fp ) { fwrite( $fp, $htaccess ); fclose( $fp ); } else { $err = "could not open $newfilename for writing"; } } else { $err = "could not open $newfilename for writing"; } } else { $err = "could not open $oldfilename for reading"; } } else { $err = "$oldfilename not found"; } if( $err != '' ) { print "
ERROR: $err"; clearstatcache(); $files = array( "htaccess.dist", ".htaccess" ); while( list( $key, $val ) = each( $files ) ) { $stats = @stat( $val ); if( $stats ) { print "$val
"; print " uid/gid: " . $stats[ 'uid' ] . "/" . $stats[ 'gid' ] . "
\n"; print " size: " . $stats[ 'size' ] . "
"; print " perms: " . substr( sprintf('%o', fileperms( $val ) ), -4 ) . "
"; print " readable: "; print is_readable( $val ) == true ? "yes" : "no"; print "
"; print " writeable: "; print is_writeable( $val ) == true ? "yes" : "no"; print "
"; } elseif( file_exists( $val ) == false ) { print "$val
"; print " FILE NOT FOUND: $val
"; } } print "
There was a problem creating the .htaccess file in $realpath.
"; print "Error: "; if( $err == "could not open $newfilename for writing" ) { print "Could Not Write To $newfilename."; } elseif( $err == "could not open $oldfilename for reading" ) { print "I could not read from $oldfilename. "; } elseif( $err == "$oldfilename not found" ) { print "The file, $oldfilename, is missing."; } print "
"; filestats( $err ); print "Please ensure that the webserver can write to this directory.
"; print "If you use Cpanel then read this post. Cpanel creates files that I need to overwrite and you have to fix that.
"; print "If all else fails then you'll have to create it by hand:"; print "
One or more of the above directories must be made writeable by the webserver.
";
print "Please chmod 777
or directory-name
chown
that directory to the user the web server runs as (usually nobody, apache, or www-data)
";
print "Refresh this page when you're done!
A file with the name '.htaccess' already exists in this directory and I cannot write to it. Please ftp to the server and delete this file from this directory!
";
print "Offending file: " . realpath( '.htaccess' ) . "
Please make sure mod_rewrite is installed as it will be activated at the end of this install.
If mod_rewrite is disabled ask your administrator to enable that module, or look at the Apache documentation or elsewhere for help setting it up.
"; if( checkdirs() == false ) { return false; } // Create default template cache dirs @mkdir( dirname(__FILE__) . "/wp-inst/wp-content/smarty-cache" , 0777 ); @mkdir( dirname(__FILE__) . "/wp-inst/wp-content/smarty-templates_c" , 0777 ); // Create Blogs living area. @mkdir( dirname(__FILE__) . "/wp-inst/wp-content/blogs.dir", 0777 ); $url = "http://".$_SERVER["SERVER_NAME"] . dirname( $_SERVER[ "SCRIPT_NAME" ] ); if( substr( $url, -1 ) == '/' ) $url = substr( $url, 0, -1 ); $base = dirname( $_SERVER["SCRIPT_NAME"] ); if( $base != "/") { $base .= "/"; } $realpath = dirname(__FILE__); if( is_file( dirname(__FILE__) . "./wp-inst/wpmu-settings.php" ) == false ) { $configfile = ''; $fp = fopen( "./wp-inst/wpmu-settings.php.dist", "r" ); if( $fp ) { while( !feof( $fp ) ) { $configfile .= fgets( $fp, 4096 ); } fclose( $fp ); } $configfile = str_replace( "BASE", $base, $configfile ); $fp = fopen( "./wp-inst/wpmu-settings.php", "w" ); fwrite( $fp, $configfile ); fclose( $fp ); } return true; } function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'password', $dbhost = 'localhost', $prefix = 'wp_' ) { print " "; } function step2() { $dbname = $_POST['dbname']; $uname = $_POST['uname']; $passwrd = $_POST['pwd']; $dbhost = $_POST['dbhost']; $vhost = $_POST['vhost' ]; $prefix = $_POST['prefix']; if (empty($prefix)) $prefix = 'wp_'; // Test the db connection. define('DB_NAME', $dbname); define('DB_USER', $uname); define('DB_PASSWORD', $passwrd); define('DB_HOST', $dbhost); if (!file_exists('wp-inst/wp-config-sample.php')) die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); $configFile = file('wp-inst/wp-config-sample.php'); // We'll fail here if the values are no good. require_once('wp-inst/wp-includes/wp-db.php'); printheader(); print "Creating Database Config File: "; $handle = fopen('wp-inst/wp-config.php', 'w'); foreach ($configFile as $line_num => $line) { switch (substr($line,0,16)) { case "define('DB_NAME'": fwrite($handle, str_replace("wordpress", $dbname, $line)); break; case "define('DB_USER'": fwrite($handle, str_replace("'username'", "'$uname'", $line)); break; case "define('DB_PASSW": fwrite($handle, str_replace("'password'", "'$passwrd'", $line)); break; case "define('DB_HOST'": fwrite($handle, str_replace("localhost", $dbhost, $line)); break; case "define('VHOST', ": fwrite($handle, str_replace("VHOSTSETTING", $vhost, $line)); break; case '$table_prefix =': fwrite($handle, str_replace('wp_', $prefix, $line)); break; default: fwrite($handle, $line); } } fclose($handle); chmod('wp-inst/wp-config.php', 0666); print "DONEWell Done! Your blog has been set up and you have been sent details of your login and password in an email.
"; print "You may view your new blog by visiting ".$url."!
"; } else { if( $res == 'error: problem creating blog entry' ) { print "Themainblog has already been created. Edit your blogs table and delete the entry for this domain!"; } elseif( $res == 'error: username used' ) { print "The username you chose is already in use, please select another one."; } print "