From d48e85e0ac5e675ca33fac173f30c75403d1033f Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 22 Jun 2006 18:31:50 +0000 Subject: Moved everything in wp-inst down a directory. Uses's Ryan Boren's htaccess rules and mods If you're upgrading, try this on a test server first! git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@591 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- index-install.php | 450 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 450 insertions(+) create mode 100644 index-install.php (limited to 'index-install.php') diff --git a/index-install.php b/index-install.php new file mode 100644 index 0000000..95c86ef --- /dev/null +++ b/index-install.php @@ -0,0 +1,450 @@ + + + + WordPress › Installation + + + + + +

WordPress MU

+'; +} + +function check_writeable_dir( $dir, $ret ) { + if( is_writeable( $dir ) == false ) { + print $dir." : FAILED
Quick Fix: chmod 777 $dir
"; + return false; + } else { + if( $ret == true ) { + return true; + } else { + return false; + } + } +} + +function filestats( $err ) { + print "

Server Summary

"; + print "

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 "
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 "
"; + +} + +function do_htaccess( $oldfilename, $newfilename, $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( "BASE", $base, $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 "

Warning!

"; + print "

There was a problem creating the .htaccess file.

"; + 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 "