labrat407 Posted March 24, 2009 Share Posted March 24, 2009 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: 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 Quote Link to comment Share on other sites More sharing options...
codestips Posted March 25, 2009 Share Posted March 25, 2009 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: 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.