When I do the initial install I get this:


Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 18
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 19
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 20
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 22
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\Hosting\6585577\html\rhythmmovement\install\index.php on line 24
Installation successfull
File "installdone.txt" has been created, if You want to run the "Installation wizard" again, You must delete that file.
Default username and password is "admin".
You can now go to Your Blog.


here is the install index.php file contents:

<?php
function str_replace_once($search, $replace, $target) {
 $startPos = strpos($target, $search);
 if ( !($startPos === 0 || $startPos > 0) ) return $target;
 $endPos   = $startPos + strlen($search);
 return substr( $target, 0, $startPos ) . $replace . substr( $target, $endPos );
}

if ( file_exists('installdone.txt') ) exit;
if (substr($_SERVER['DOCUMENT_ROOT'], -1)=='/' || substr($_SERVER['DOCUMENT_ROOT'], -1)=='\\') {;} else { $finalslash=DIRECTORY_SEPARATOR; }
define('ospath', rtrim(dirname(__FILE__), 'install') );
define('basepath', rtrim(($_SERVER['SERVER_PORT']==443&&$_SERVER['HTTPS'])?'':''.$_SERVER['SERVER_NAME'].'/'.str_replace_once($_SERVER['DOCUMENT_ROOT'].$finalslash, '', ospath), '/') );
function importTables() {
   $data = file('dbinit.sql');
   $link = mysql_connect($_POST['dbserver'], $_POST['dbuser'], $_POST['dbpass']);
   mysql_select_db($_POST['dbname'], $link);
   mysql_query('set names utf8;', $link);
   foreach ( $data as $line ) {
       mysql_query($line, $link);
   }
   mysql_query('insert into blog_articles_settings(`id`, `path`, `background`, `logo`, `mp3`, `comments`, `copyright`, `sitepath`, `fbid`, `fbnum`, `fb`, `fbdescription`, `tw`, `twdescription`, `ms`, `msdescription`, `ld`, `lddescription`, `di`, `didescription`, `yt`, `ytdescription`, `vm`, `vmdescription`, `fl`, `fldescription`, `lf`, `lfdescription`, `tb`, `tbdescription`, `su`, `sudescription`, `dl`, `dldescription`, `rd`, `rddescription`, `tr`, `trdescription`) values("1", "'.('http://'.basepath).'", "null", "null", "null", "No", "2010 Flash Blog Special. All right reserved.", "", "", "10" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "") ;', $link);
   if ($link) mysql_close($link);
   return true;
};
$installationDone = false;
if (!is_writeable('./') || !is_writeable('./../') || !is_writeable('./../uf') || !is_writeable('./../uf/advertising')|| !is_writeable('./../uf/article')|| !is_writeable('./../uf/settings')|| !is_writeable('./../uf/userfiles')) { $_POST['step']=null; }
if ( $_POST['step'] ) {
   switch ( $_POST['step'] ) {
       case '2' :
       if ( $_POST['sitepath'] &&  $_POST['sitedomain'] && $_POST['dbserver'] && $_POST['dbuser'] && $_POST['dbpass'] && $_POST['dbname']) {
     if(!is_dir("./../uf/userfiles/1")) mkdir("./../uf/userfiles/1", 0777);
           $configData .= '<?php'."\n";
           $configData .= "\t".' define("DB_HOST", "'.$_POST['dbserver'].'");'."\n";
           $configData .= "\t".' define("DB_USER", "'.$_POST['dbuser'].'");'."\n";
           $configData .= "\t".' define("DB_PASS", "'.$_POST['dbpass'].'");'."\n";
           $configData .= "\t".' define("DB_NAME", "'.$_POST['dbname'].'");'."\n";
           $configData .= "\t".' define("SITE_PATH", "'.$_POST['sitepath'].'");'."\n";
           $configData .= "\t".' define("SITE_DOMAIN", "'.$_POST['sitedomain'].'");'."\n";
           $configData .= "\t".' $sitename = "'.$_POST['sitename'].'";'."\n";
           $configData .= "\t".' $sitemail = "'.$_POST['sitemail'].'";'."\n";
           $configData .= "\t".' ini_set("include_path", SITE_PATH."lib");'."\n";
           $configData .= '?>';
           if ( @file_put_contents('../site.defs.php', $configData) && importTables() ) {
               @touch('installdone.txt');
               $installationDone = true;
           }
       }
       break;
   }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Installation wizard </title>
<style type='text/css'>
body,table,input{font:9pt arial;}.titleDiv{
   font:12pt arial;
   color:#444;
   background:#E9E9E9;
   padding:4px;
   font-weight:bold;
   border: 1px solid #444444;
}.centered{
   margin-left:0%;
}.container{
   padding:4px;
   width:500px;
   border:solid 1px #999;
   background:#fafafa;
   text-align: left;
}.shortNote{
   background:#666;
   color:#eee;
   font:8pt arial;
   padding:10px;
   line-height:150%;
   border: 1px solid #444444;
   border-bottom: solid 1px #E9E9E9;
}label{
   width:240px;
   display:block;
   background:##E9E9E9;
   padding:2px;
}.shortNote2{
   background:#272727;
   color:#eee;
   font:8pt arial;
   border-top:solid 1px #444;
   border-bottom:solid 1px #444;
   padding:10px;
   line-height:150%;
}label{
   width:240px;
   display:block;
   padding:2px;
}.width240{
   width:472px;
   padding:2px;
}.submitDiv{
   margin-top:10px;
   background:#666;
   padding:4px;
   text-align:right;
   border: solid 1px #E9E9E9;
}.submitButton{font:11pt arial;padding:2px;width:60px;}.installationDoneDiv{
   font:10pt arial;
   line-height:150%;
   background:#666;
   color:#FFFBF0;
   padding:10px;
}.installationDoneDiv a{
   text-decoration:none;
   font:12pt arial;
   font-weight:bold;
   color:#FFFBF0;
}
body {
   background-color: #E2E0E0;
}
.nopermdiv {
   background:#e55;
   color:#fff;
   border:solid 1px #422;
   padding:10px;
   margin-bottom:1px;
}
</style>
</head>
<body >
<div class='centered'>
<div align="center"><div class='container'>
<?php if ( !$installationDone ) { ?>
<div class='titleDiv'>Installation wizard</div>
<div class='shortNote'>Just enter the settings and press the "Install" button.<br /> Once the installation is done, the file "installdone.txt" will be created in order to prevent further executions of the installation script.<br /> The default username and password is "<b>admin</b>"</div>
<?if (!is_writeable('./') || !is_writeable('./../') || !is_writeable('./../uf') || !is_writeable('./../uf/advertising')|| !is_writeable('./../uf/article')|| !is_writeable('./../uf/settings')|| !is_writeable('./../uf/userfiles')) { ?>
<div class='nopermdiv'>Please give WRITE permissions to this script for the following directories<br />
<?=$_POST['sitepath']!=''?$_POST['sitepath']:ospath?>
<?='<br />'.($_POST['sitepath']!=''?$_POST['sitepath'].'install/':ospath.'install/')?>
<?='<br />'.($_POST['sitepath']!=''?$_POST['sitepath'].'uf/':ospath.'uf/')?>
<?='<br />'.($_POST['sitepath']!=''?$_POST['sitepath'].'uf/advertising/':ospath.'uf/advertising/')?>
<?='<br />'.($_POST['sitepath']!=''?$_POST['sitepath'].'uf/article/':ospath.'uf/article/')?>
<?='<br />'.($_POST['sitepath']!=''?$_POST['sitepath'].'uf/settings/':ospath.'uf/settings/')?> 
<?='<br />'.($_POST['sitepath']!=''?$_POST['sitepath'].'uf/userfiles/':ospath.'uf/userfiles/')?> 

</div>
<? } ?>
<div class='shortNote2'>
<form action='<?$_SERVER['PHP_SELF']?>' method='post'>
<label for='sitename'>Site name </label>
<input type='text' name='sitename' class='width240' value="<?=$_POST['sitename']!=''?$_POST['sitename']:''?>" />
<label for='sitemail'>Site e-mail</label>
<input type='text' name='sitemail' class='width240' value="<?=$_POST['sitemail']!=''?$_POST['sitemail']:''?>" />
<label for='sitepath'>Site path</label>
<input type='text' name='sitepath'  value="<?=$_POST['sitepath']!=''?$_POST['sitepath']:ospath?>" class='width240' />
<label for='sitedomain'>Site domain</label>
<input type='text' name='sitedomain'  value="<?=$_POST['sitedomain']!=''?$_POST['sitedomain']:basepath?>" class='width240' />
<label for='dbserver'>Database server</label>
<input type='text' name='dbserver'  value="<?=$_POST['dbserver']!=''?$_POST['dbserver']:'localhost'?>" class='width240' />
<label for='dbuser'>Database user</label>
<input type='text' name='dbuser'   value="<?=$_POST['dbuser']!=''?$_POST['dbuser']:''?>"  class='width240' />
<label for='dbpass'>Database password</label>
<input type='password' name='dbpass'  value="<?=$_POST['dbpass']!=''?$_POST['dbpass']:''?>" class='width240' />
<label for='dbname'>Database name</label>
<input type='text' name='dbname'   value="<?=$_POST['dbname']!=''?$_POST['dbname']:''?>"  class='width240' />
<div class='submitDiv'>
<input type='hidden' name='step' value='2'>
<input type='submit' value='Install' class='submitButton'>
</div>
</form>
</div></div>
<?php } else { ?>
<div class='installationDoneDiv'>
   Installation successfull<br />
   File "installdone.txt" has been created, if You want to run the "Installation wizard" again, You must delete that file.<br />
   Default username and password is "<b>admin</b>".<br />
<a href="http://<?=$_POST['sitedomain']!=''?$_POST['sitedomain']:basepath?>">You can now go to Your Blog.</a>
</div>
<? } ?>
</div>
</div>

then I go to the site http://www.rhythmmovement.com/rhythmmovement/ and get

Parse error: syntax error, unexpected T_STRING in D:\Hosting\6585577\html\rhythmmovement\site.defs.php on line 7
and the contents of that file (site.defs.php) is the following

<?php
  define("DB_HOST", "localhost");
  define("DB_USER", "rmhost");
  define("DB_PASS", "Paxxxxxxx7");
  define("DB_NAME", "PSC");
  define("SITE_PATH", "D:\Hosting\6585577\html\rhythmmovement\");

  define("SITE_DOMAIN", "www.rhythmmovement.com/rhythmmovement\");

  $sitename = "rhythmmovement.com";
  $sitemail = "host@rhythmmovement.com";
  ini_set("include_path", SITE_PATH."lib");
?>

This is everything. Please help...

Enclose your code within CODE-tag

Your database is not connected. Your input dbserver/dbuser/dbpass is wrong.

Please use code tags to add your code.

Your mysql credentials is wrong apart from that
The string error is because on

define("SITE_PATH", "D:\Hosting\6585577\html\rhythmmovement\");

The last \ (back slash) ignore double qoute and string is broken.
Try below.

define("SITE_PATH", "D:\Hosting\6585577\html\rhythmmovement\\");

Slashes are special characters in PHP. I think you should escape the slashes.

define("SITE_PATH", "D:\\Hosting\\6585577\\html\\rhythmmovement\\");

It can work both.

THe above takes me away from the database. It says it can't find it

this is the error message after the above solution is applied


Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\6585577\html\rhythmmovement\index.php on line 9

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\6585577\html\rhythmmovement\index.php on line 10

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in D:\Hosting\6585577\html\rhythmmovement\index.php on line 10

Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\6585577\html\rhythmmovement\index.php on line 11

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\Hosting\6585577\html\rhythmmovement\index.php on line 11
Can't connect to MySQL server on 'localhost' (10061)

Your codes are so clutter. I can't read well. And wrap the codes with code tag which provided on the toolbar (CODE) button.

The error says 'mysql_connect()' failed at called, which maybe wrong host, username, password. Check the host, username, password for that database you're using, and put the correct info.

Member Avatar for diafol

Get rid of all that css and nonsense. Just post the relative bits. Some of us get bored really easily...

And for Pete's sake, use [ CODE ] tags. Read the posting guidelines if you don't have a clue about it.

Sorry, thought responders would have enough experience to know code from explanation. Just wanted to give a clearer picture as I have been on the other side where too little was given to diagnose the issue. Being new to this site I was unaware of the etiquette but will abide. Right now though instead of a courtesy email, it would be great to get an answer I can work with, thanks.

>Sorry, thought responders would have enough experience to know code from explanation
It's not about level of experience of the responders, it's about courtesy to those who might volunteer their own time to try help you out. Code tags make the code much easier to follow.

Member Avatar for diafol

Right now though instead of a courtesy email, it would be great to get an answer I can work with, thanks.

Now that Ezzaral has code-tagged your post for you, you may be in luck.

This is your problem:

"D:\Hosting\6585577\html\rhythmmovement\");

The backslash acts as an 'escaper' - changing the enclosing " to a literal '"', effectively making the rest of the code text until the next unescaped ".

Anyway, change backslashes to forward slashes for paths.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.