Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
1 registered (Bjab), 25 Guests and 16 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 06/05/06
Posts: 469
Top Posters (30 Days)
Ruben 50
DennyP 24
Gizmo 23
Dunny 15
SteveS 13
AllenAyres 12
SD 10
dbremer 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#28031 - 06/26/03 11:49 PM Newbie stuck in step 7
Anonymous
Unregistered

Howdy,

Everthing looked like it was going okay and then step 7 is not what I expected. What I got was a page on my browser that had the following:

BODY,TABLE { color: #333333; font-family: verdana; font-size: 12px; font-weight: bold; } .HEADER { color: #CC9933; font-size: 14px; } UBB.threads Installation Wizard


Step $step
"; } // Print out the footer function basic_footer() { echo "
"; echo ""; } // ---------------------------------------------------------------------- // STEP 1 function step1() { $step = 1; $scriptname = find_environmental('PHP_SELF'); basic_header($step); echo " In order to automate the installation procedure, we first need to make sure all of the proper files have write access. If any of these checks fail you will need to change the permissions on these files. (Chmod 666 or 664 on linux and granting write access to the files/directories on Windows. Your stylesheets, images/icons and images/graemlins directories will probably need to be 777 so you can create new stylesheets, icons and graemlins from the admin section).
Note: The only files that are necessary at this point are main.inc.php, config.inc.php and theme.inc.php. If any of the non-critical files fail you can continue the installation and change the permissions on these once the program is installed.


Main Directory
main.inc.php "; $check = @fopen("main.inc.php","a"); if (!$check) { echo " FAILED "; $fail = 1; } else { echo " PASSED "; } echo "
config.inc.php "; $check = @fopen("config.inc.php","a"); if (!$check) { echo " FAILED "; $fail = 1; } else { echo " PASSED "; } echo "
theme.inc.php "; $check = @fopen("theme.inc.php","a"); if (!$check) { echo " FAILED "; $fail = 1; } else { echo " PASSED "; } echo "
filters/all "; $dir = opendir("filters"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("filters/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ){ echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
includes/.php files "; $dir = opendir("includes"); while ($file = readdir($dir)) { $check = ""; if (!ereg(".php",$file) ) { continue; } $check = @fopen("includes/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
stylesheets/all "; $dir = opendir("stylesheets"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("stylesheets/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
images/icons/all "; $dir = opendir("images/icons"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("images/icons/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
images/graemlins/all "; $dir = opendir("images/graemlins"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("images/graemlins/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
"; if ($fail) { echo "One or more of the above files does not have write permissions. Please correct this and click the button below to try again.
"; } elseif ($nocrit) { echo "Some of the non-critical files do not have write permissions. You can try to correct these now and check again or you can worry about these later and continue with the installation. NOTE: Permissions will need to be changed on these files in order to use some of the admin functions.
"; } else { echo "All checks passed.
"; } echo "
"; basic_footer(); } // ------------------------------------------------------------------------- // STEP 2 function step2($step="",$dbserver,$dbname,$dbuser,$dbpass,$servererror,$nameerror,$usererror,$passerror,$tbprefix,$cookieprefix) { if (!$dbserver) { $dbserver = "localhost"; } basic_header($step); $scriptname = find_environmental('PHP_SELF'); echo " This next step consists of gathering the database information. You will need to know the server the mysql engine is running on, the database name, the username, and the password if necessary.
Database server $servererror
Database name $nameerror
Database user $usererror
Database password $passerror
Tablename prefix (no spaces)

"; basic_footer(); } // ---------------------------------------------------------------------- // STEP 3 function step3($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$tbprefix="",$cookieprefix="") { $scriptname = find_environmental('PHP_SELF'); $tbprefix = str_replace(" ","",$tbprefix); if (!$tbprefix) { $tbprefix = "w3t_"; } basic_header($step); echo " Here we are checking your database connectivity and permissions. If any of these checks fail you will need to correct the errors in order to proceed.
Connecting to server "; $check = mysql_connect($dbserver,$dbuser,$dbpass); if (!$check) { echo "FAILED "; $servererror="?"; $usererror="?"; $passworderror="?"; $fail = 1; } else { echo "PASSED"; } echo "
Connecting to database "; if (!$fail) { $check2 = mysql_select_db($dbname,$check); } if ( ($fail) || (!$check2) ) { echo "FAILED "; $nameerror = "?"; $fail = 1; } else { echo "PASSED"; } if ($fail) { echo "
One or more of the above checks failed. Click the button below to return to the previous screen to verify your settings.
"; } else { echo "
Creating a table "; $query = "CREATE TABLE UBBT_TEST(TEST text)"; $sth = mysql_query($query,$check); if (!$sth) { echo "FAILED"; $nocreate=1; } else { echo "PASSED"; } echo "
Dropping a table "; $query = "DROP TABLE UBBT_TEST"; $sth = mysql_query($query,$check); if (!$sth) { echo "FAILED"; $nodrop=1; } else { echo "PASSED"; } if ( ($nocreate) || ($nodrop) ) { echo "
You do not have all of the necessary permissions to this database. You need to make sure that the supplied username/password combination gives you full control to the specified database.
You may run the tests again if you have cleared this problem up, or you may return to the previous screen to change your database variables.


"; } else { echo "

All test passed

"; } } echo "
"; basic_footer(); } // ---------------------------------------------------------------------- // STEP 4 function step4($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$phpurl="",$images="",$styledir="",$path="",$imagepath="",$stylepath="",$referer="",$phpurlerror="",$imageserror="",$st yledirerror="",$patherror="",$imagepatherror="",$stylepatherror="",$referererror="",$tbprefix="",$cookieprefix="") { $scriptname = find_environmental('PHP_SELF'); basic_header($step); if (!$phpurl) { $What = find_environmental('REQUEST_URI'); $script['0'] = ""; preg_match("/(.*)\/(.*)\.php/",$What,$script); $url = $script['1']; $phpurl = $url; } if (!$images) { $images = "$url/images"; } if (!$path) { $path = find_environmental('SCRIPT_FILENAME'); $script['0'] = ""; preg_match("/(.*)\/(.*)\.php/",$path,$script); $path = $script['1']; } if (!$imagepath) { $imagepath = $path . "/images"; } if (!$styledir) { $styledir = "$url/stylesheets"; } if (!$stylepath) { $stylepath = $path . "/stylesheets"; } if (!$referer) { $referer = "http://" . find_environmental('HTTP_HOST'); } echo " Next we need to gather information on the paths and url of your installation. Some of these values are pre-filled but may not be correct depending on your system. Please change if necessary.

The domain UBB.threads will be run on
$referererror

Absolute URL to the UBB.threads install
$phpurlerror

Absolute URL to image directory
$imageserror

Absolute URL to stylesheets directory
$styledirerror

Path to your UBB.threads install
$patherror

Path to your images directory
$imagepatherror

Path to your stylesheets directory
$stylepatherror

Custom cookie prefix (Can be left blank. Useful if you have 2 installs and don't want cookies from one causing problems with the other)


"; echo " "; basic_footer(); } // ---------------------------------------------------------------------- // STEP 5 function step5($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$phpurl="",$images="",$styledir="",$path="",$imagepath="",$stylepath="",$referer="",$tbprefix="",$cookieprefix="") { $scriptname = find_environmental('PHP_SELF'); basic_header($step); echo " Checking all path/url information. Please make sure you have all files uploaded, or you will get false reporing. NOTE: The first 3 might fail if PHP is unable to open files via a URL. If that is the case you may continue to the next step.

"; echo " phpurl ($referer{$phpurl}) "; $check = @fopen("$referer{$phpurl}/createtable.php","r"); if (!$check) { echo "UNABLE TO OPEN"; $nocrit=1; $phpurlerror="?"; } else { echo "PASSED"; } echo "
"; echo " images ($referer{$images}) "; $check = @fopen("$referer{$images}/flat.gif","r"); if (!$check) { echo "UNABLE TO OPEN"; $nocrit = 1; $imageserror="?"; } else { echo "PASSED"; } echo "
"; echo " styledir ($referer{$styledir}) "; $check = @fopen("$referer{$styledir}/infopop.css","r"); if (!$check) { echo "UNABLE TO OPEN"; $nocrit = 1; $styledirerror="?"; } else { echo "PASSED"; } echo "
"; echo " path ($path) "; $check = @fopen("$path/createtable.php","r"); if (!$check) { echo "FAILED"; $fail = 1; $patherror="?"; } else { echo "PASSED"; } echo "
"; echo " imagepath ($imagepath) "; $check = @fopen("$imagepath/flat.gif","r"); if (!$check) { echo "FAILED"; $fail = 1; $imagepatherror="?"; } else { echo "PASSED"; } echo "
"; echo " stylepath ($stylepath) "; $check = @fopen("$stylepath/infopop.css","r"); if (!$check) { echo "FAILED"; $fail = 1; $stylepatherror="?"; } else { echo "PASSED"; } echo "
"; if ( ($fail) || ($nocrit) ) { echo "
One or more of the above checks have failed. You might need to go back and verify your settings.
"; } else { echo "

All checks passed. "; } echo "
"; echo " "; basic_footer(); } // ---------------------------------------------------------------------- // STEP 6 function step6($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$phpurl="",$images="",$styledir="",$path="",$imagepath="",$stylepath="",$referer="",$tbprefix="",$cookieprefix="") { global $thisversion; $scriptname = find_environmental('PHP_SELF'); $referer = preg_replace("/\/$/","",$referer); // ------------------------------------- // Let's print out the basic config file $newconfig = << EOF; // -------------------- // Write the new config $fd = fopen("config.inc.php","w"); fwrite($fd,$newconfig); fclose($fd); // ----------------------------------------------------------- // Now let's write the main.inc.php file with the proper path $mainfile = << EOF; $fd = fopen("main.inc.php","w"); fwrite($fd,$mainfile); fclose($fd); $step = 6; basic_header($step); echo " All config files have been created. You may now proceed to creating the database tables.
"; basic_footer(); } function find_environmental ($name) { global $HTTP_SERVER_VARS; $this = ""; // Regular way if(getenv($name) != '') { $this = getenv("$name"); } // end if // Irregular way if(($this == '') && ($HTTP_SERVER_VARS["$name"] != '')) { $this = $HTTP_SERVER_VARS["$name"]; } // end if // 4.1 way if(($this == '') && ($_ENV["$name"] != '')) { $this = $_ENV["$name"]; } // end if return $this; } // end func function get_input ($name="",$type="") { global $HTTP_POST_VARS, $HTTP_GET_VARS; global $_POST, $_GET, $_COOKIE, $_SESSION; $this = ""; if (isset($_GET["$name"])) { $this = $_GET["$name"]; return $this; } elseif (isset($HTTP_GET_VARS["$name"])) { $this = $HTTP_GET_VARS["$name"]; return $this; } if (isset($_POST["$name"])) { $this = $_POST["$name"]; return $this; } elseif (isset($HTTP_POST_VARS["$name"])) { $this = $HTTP_POST_VARS["$name"]; return $this; } } ?>

Is this right?

Thanks
Top
#28032 - 06/27/03 01:28 AM Re: Newbie stuck in step 7
Anonymous
Unregistered

If you're seeing php code like that in the browser - then PHP stopped running on the server.

If it's your server, you probably need to restart PHP - if not - I'd check with your host.

Josh
www.joshuapettit.com
ThreadsDev.com Administrator | InfoPop Community Moderator
Register to see my How To/Site Help Library Forum at ThreadsDev.com.
My threads 'tweaking' abilities are for hire for upgrades, tweaks and modifications.
Top



Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Temporary Password email not being received
by
05/24/12 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Forum Stats
10492 Members
36 Forums
33842 Topics
181709 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image