Jump to content

Error installing DB for estore


labrat407

Recommended Posts

Hi one and all,

I am hoping that I can get some help or insight to an installation issue.

I am looking to install an older estore script on my host, and when I run the setup I get the following after entering the information for the DB and user accounts.

 

Here is the code:

<html>
<head>
<style type="text/css">
body {font-family: arial}
</style></head>

<body bgcolor='#CCCCFF'>

<?php


$title="<?php \n //This page contains the database settings for your website \n";
$file = fopen( "includes/db.conf.php", "w" );
fwrite( $file, $title );
$setings="$" ."db_username='" .$_POST['username'] ."';\n";
$setings.="$" ."db_password='" .$_POST['password'] ."';\n";
$setings.="$" ."db_server='localhost';\n";
$setings.="$" ."db_type='mysql';\n";
$setings.="$" ."db_db='" .$_POST['database'] ."';\n";
$setings.="$" ."admin='" .$_POST['adusername'] ."';\n";
$setings.="$" ."adpass='" .$_POST['adpassword'] ."';\n";

fwrite( $file, $setings );
fwrite( $file, "?>" );

print "Database parameters set.  Press Continue <br><br>";

echo "<form action='dbsetup.php' method=post>";
echo "<input type='hidden' name='username' value='$_POST[adusername]'>";
echo "<input type='hidden' name='password' value='$_POST[adpassword]'>";
echo "<input type='submit' name='submit' value='Continue'>";
?>

</body>
</html>

 

And the errors that come up:

  Quote

 

 

 

Warning: fopen(includes/db.conf.php) [function.fopen]: failed to open stream: Permission denied in /home/xxx/public_html/xxx.com/dbsettings.php on line 13

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/xxx.com/dbsettings.php on line 14

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/xxx.com/dbsettings.php on line 23

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/xxx.com/dbsettings.php on line 24

Database parameters set. Press Continue

 

My host is up to date on PHP and SQL Etc., But I am not sure if the code needs to be updated. I have a little code knowledge mostly simple web design tweaking. I am willing to learn but not sure where to start diagnosing the issue.

Any help would be appreciated.

Thanks

Link to comment
https://forums.phpfreaks.com/topic/150968-error-installing-db-for-estore/
Share on other sites

  Quote

Hi one and all,

I am hoping that I can get some help or insight to an installation issue.

I am looking to install an older estore script on my host, and when I run the setup I get the following after entering the information for the DB and user accounts.

 

Here is the code:

<html>
<head>
<style type="text/css">
body {font-family: arial}
</style></head>

<body bgcolor='#CCCCFF'>

<?php


$title="<?php \n //This page contains the database settings for your website \n";
$file = fopen( "includes/db.conf.php", "w" );
fwrite( $file, $title );
$setings="$" ."db_username='" .$_POST['username'] ."';\n";
$setings.="$" ."db_password='" .$_POST['password'] ."';\n";
$setings.="$" ."db_server='localhost';\n";
$setings.="$" ."db_type='mysql';\n";
$setings.="$" ."db_db='" .$_POST['database'] ."';\n";
$setings.="$" ."admin='" .$_POST['adusername'] ."';\n";
$setings.="$" ."adpass='" .$_POST['adpassword'] ."';\n";

fwrite( $file, $setings );
fwrite( $file, "?>" );

print "Database parameters set.  Press Continue <br><br>";

echo "<form action='dbsetup.php' method=post>";
echo "<input type='hidden' name='username' value='$_POST[adusername]'>";
echo "<input type='hidden' name='password' value='$_POST[adpassword]'>";
echo "<input type='submit' name='submit' value='Continue'>";
?>

</body>
</html>

 

And the errors that come up:

  Quote

 

 

 

Warning: fopen(includes/db.conf.php) [function.fopen]: failed to open stream: Permission denied in /home/xxx/public_html/xxx.com/dbsettings.php on line 13

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/xxx.com/dbsettings.php on line 14

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/xxx.com/dbsettings.php on line 23

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/xxx.com/dbsettings.php on line 24

Database parameters set. Press Continue

 

My host is up to date on PHP and SQL Etc., But I am not sure if the code needs to be updated. I have a little code knowledge mostly simple web design tweaking. I am willing to learn but not sure where to start diagnosing the issue.

Any help would be appreciated.

Thanks

 

HI , you need to set the write permission to that file db.conf.php. On your ftp client, right click and change permission to 666.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.