ola!
fui tentar instalar este script e obtive este erro:Installation Step 1 - Failed
The script could not connect to MySQL because Access denied for user 'root'@'localhost' (using password: NO)
o nome da base de dados, do utilizador e a password(que são: freedoom_imagens(db), freedoom_imagens(username)e a pass...) foram colocadas correctamente, eu suspeito que seja algum erro do script(ou não)..
vou colocar aqui o install.php:<?php
ini_set('display_errors', 1);
error_reporting(E_ALL & ~ E_NOTICE);
function headerprint()
{
echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>|| Img Upload - Installation ||</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,th {
color: #333333;
font-family: Lucida Sans;
font-size: 12px;
}
a:link {
color: #2757AF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #2757AF;
}
a:hover {
text-decoration: underline;
color: #7B9FE1;
}
a:active {
text-decoration: none;
color: #2757AF;
}
body {
background-image: url(images/bg.gif);
margin-left: 0px;
margin-right: 0px;
margin-top: 50px;
margin-bottom: 50px;
}
input {
background-color: #F2F2F2;
color: #2554AA;
font-family: Verdana;
font-size: 11;
}
}
.style2 {font-size: 9px}
.style3 {font-size: 12px}
.style5 {color: #2757AF}
-->
</style>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0"
width="580">
<tbody>
<tr>
<td colspan="3" align="left" background="images/index_01.gif"
height="137" valign="bottom">
<p class="style3"> <br>
</p>
</td>
</tr>
<tr>
<td colspan="3"> <img src="images/index_02.gif" alt=""
height="15" width="580"></td>
</tr>
<tr>
<td rowspan="5" align="left" background="images/index_03.gif"
valign="top"> <img src="images/index_03.gif" alt="" height="174"
width="21"></td>
<td align="left" background="images/index_04.gif" valign="middle"><center>ImgUpload Installation</center>
<br>
</span></strong> </td>
<td rowspan="5" align="left" background="images/index_05.gif"
valign="top" width="24"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" height="130" valign="top"
width="535">
<p><a href="#"></a> </p>
<center>');
}
function footerprint()
{
echo('<p><br>
</p>
</center>
<p> </p>
</td>
</tr>
<tr>
<td> <img src="images/index_08.gif" alt="" height="4" width="535"></td>
</tr>
<tr>
<td align="left" background="images/index_09.gif" nowrap="nowrap"
valign="top"> <span class="style2"><font face="Arial"></font></span></td>
</tr>
<tr>
<td colspan="3" align="center" background="images/index_10.gif"
height="54" valign="middle"><span class="style2"> Copyright IMG
Upload, by <a href="http://hellscythe.net">Hellscythe</a> </span></td>
</tr>
</tbody>
</table>
</body>
</html>');
}
headerprint();
function echobr($text)
{
echo("" . $text . "<br />");
return;
}
if($_POST['finishstep'] == "1")
{
installstep1($mysqlhost, $mysqluser, $mysqlpass, $mysqldb);
} elseif($_POST['finishstep'] == "2")
{
if(empty($_POST['inputuser']) || empty($_POST['inputpass']) || empty($_POST['inputemail']))
{
echo("You didn't fill out a required field, please go back and try again");
footerprint();
exit();
}
installstep2($inputuser, $inputpass, $inputemail, $imgupaccess, $uploadmax);
} elseif($_POST['finishstep'] == "3")
{
installstep3($inputuser, $inputpass, $inputemail, $imgupaccess, $uploadmax);
}
if($_POST['installstep'] == "1")
{
echo('<p><form action="install.php" method="post" />');
echobr("<u>MySQL Information:</u><br />");
echobr('MySQL Host: <input type="text" name="mysqlhost" value="localhost" />');
echobr('MySQL User: <input type="text" name="mysqluser" />');
echobr('MySQL Pass: <input type="password" name="mysqlpass" />');
echobr('MySQL Database: <input type="text" name="mysqldb" />');
echobr('<input type="hidden" name="finishstep" value="1" />');
echobr('<input type="submit" name="submitstep1" value="Finish Step 1" />');
echo('</form></p>');
footerprint();
exit();
} elseif ($_POST['installstep'] == "2")
{
echo('<p><form action="install.php" method="post" />');
echo('<p>If you are unsure about what to put for Max Upload Size, leave it blank to use the default(2mb).</p>');
echobr('<u>Adminstrater Information:</u>');
echobr('Username: <input type="text" name="inputuser" />');
echobr('Password: <input type="password" name="inputpass" />');
echobr('E-Mail Address: <input type="text" name="inputemail" />');
echo('<input type="hidden" name="imgupaccess" value="admin" /></p>');
echobr('<input type="hidden" name="finishstep" value="2" />');
echobr('<input type="submit" name="submitstep2" value="Finish Step 2" />');
echo('</form></p>');
footerprint();
exit();
} elseif ($_POST['installstep'] == "3")
{
echobr("Installation completed succesfully. For security reasons, the installation file should be deleted.");
echo('<form action="install.php" method="post">');
echo('<input type="hidden" name="finishstep" value="3" />');
echobr('<input type="submit" name="submitstep3" value="Delete install file" />');
footerprint();
exit();
}
function installstep1($mysqlhost, $mysqluser, $mysqlpass, $mysqldb)
{
if(@mysql_connect($mysqlhost, $mysqluser, $mysqlpass))
{
if(@mysql_select_db($mysqldb))
{
if($opendbfile = fopen('mysql.db.php', 'w+'))
{
$dbwritefile = fwrite($opendbfile, '<?php
$mysqlhost = "' . $_POST['mysqlhost'] . '";
$mysqluser = "' . $_POST['mysqluser'] . '";
$mysqlpass = "' . $_POST['mysqlpass'] . '";
$mysqldb = "' . $_POST['mysqldb'] . '";
?>');
if($dbwritefile == True)
{
$tablegen = 'CREATE TABLE imgupload(userid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY
KEY, user VARCHAR(30) NOT NULL, pass VARCHAR(30) NOT NULL, emailaddr VARCHAR(50) NOT NULL,
access VARCHAR(7) NOT NULL)';
if(@mysql_query($tablegen))
{
echobr('Installation Step 1 - <font color="green"><b>Success!</b></font>');
echo('<form action="install.php" method="post" />');
echo('<input type="hidden" name="step1check" value="complete" />
<input type="hidden" name="installstep" value="2" />');
echobr('<input type="submit" name="refrinstall" value="Proceed to Step 2" />');
echo('</form>');
} else {
echobr('Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr("The error occured while generating the MySQL table. <b>" . mysql_error() . "</b>");
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The script could not write the MySQL information to <b>mysql.db.php</b>, please make sure
it has been chmodded to 0777.</p>');
fclose($dbwritefile);
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The script could not open <b>mysql.db.php</b>, please make sure it exists, and it has been
chmodded to 0777.</p>');
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr("The script could not select the database given because<b> " . mysql_error() . "</b>");
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr("The script could not connect to MySQL because<b> " . mysql_error() . "</b>");
}
footerprint();
exit();
}
function installstep2($inputuser, $inputpass, $inputemail, $uploadmax, $imgupaccess)
{
require("mysql.db.php");
if(@mysql_connect($mysqlhost, $mysqluser, $mysqlpass))
{
if(@mysql_select_db($mysqldb))
{
$addadmin = "INSERT INTO imgupload(user, pass, emailaddr, access)
values ('{$_POST['inputuser']}', '{$_POST['inputpass']}', '{$_POST['inputemail']}', '{$_POST['imgupaccess']}')";
if(@mysql_query($addadmin)) {
$umask = umask(0);
if(mkdir("{$_POST['inputuser']}", 0777))
{
umask($umask);
if($openconfig = fopen('config.db.php', 'w+'))
{
if($_POST['uploadmax'] == "")
{
$uploadmax = 2000000;
}
$dbwritefile = fwrite($openconfig, '<?php
$uploadmax = "' . $uploadmax . '";
?>');
if($dbwritefile == True)
{
echobr('<p>Installation Step 2 - <font color="green"><b>Success!</b></font>');
echobr('<form action="install.php" method="post" />
<input type="hidden" name="step2check" value="complete" />
<input type="hidden" name="installstep" value="3" />
<input type="submit" name="refrinstall" value="Finish installation" />
</form></p>');
fclose($openconfig);
mysql_close();
}
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The error occured while creating the admin directory - Please make sure that this directory
has been chmodded to 0777.</p>');
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The error occured while adding the admin user to the table.</p>');
}
} else { echobr("Installation could not select the specified database because: <b>" . mysql_error() . "</b>");}
} else { echobr("Installation could not connect to the MySQL host because: <b>" . mysql_error() . "</b>"); }
footerprint();
exit();
}
function installstep3()
{
unlink("install.php");
echobr('Installation deleted. Click <a href="index.php">here</a> to login.');
footerprint();
exit();
}
$getpath = dirname(__FILE__);
$tehpath = str_replace("\\", "/", $getpath)."/";
if(is_writable("mysql.db.php")) { $mysqlwrite = True; } else { $mysqlwrite = False; }
if(is_writable("config.db.php")) { $configwrite = True; } else { $configwrite = False; }
if(is_writable($tehpath)) { $dirwrite = True; } else { $dirwrite = False; }
if($mysqlwrite == False) { echobr("<b>mysql.db.php</b> - Is not writable, please chmod this file to 0777"); }
if($configwrite == False) { echobr("<b>config.db.php</b> - Is not writable, please chmod this file to 0777"); }
if($dirwrite == False) { echobr("<b>$tehpath</b> - Is not writable, please chmod this directory to 0777"); }
if($mysqlwrite && $configwrite && $dirwrite == True)
{
echobr("All files and folders required are writable. Please click the button below to begin the installation.");
echo('<form action="install.php" method="post" />');
echo('<input type="hidden" name="installstep" value="1" />');
echobr('<input type="submit" name="refreshinst1" value="Begin Installation" />');
echobr('</form></p>');
footerprint();
exit();
}
footerprint();
?>
se me poderem ajudar!
obrigado.