what do i do!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

what do i do!!

Post by gaogier »

I am tring to install a topsites database but there is an error.

Warning: fopen(./config.php): failed to open stream: Permission denied in /home/gaogier/public_html/top100sites/install.php on line 185
You do not have permission to write to ./config.php Make sure you CHMOD 666 config.php

Here is the correct lines of the code

Code: Select all

\$CONFIGї'version'] = '4.2.2 (2005-01-10)';
\$TMPLї'version'] = \$CONFIGї'version'];
?>
EndHTML;

    $file = $FORMї'path'].&quote;/config.php&quote;;
    $fh_config = fopen($file, &quote;w&quote;) or die(&quote;You do not have permission to write to 
&quote;.$FORMї'path'].&quote;/config.php  Make sure you CHMOD 666 config.php.&quote;);
    fwrite($fh_config, $newconfig);
    fclose($fh_config);
Line 185 is $file = $FORM['path']."/config.php";

what do i need to do?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Moved to PHP Code
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I guess the error nicely devugs that one for you ;)

Use FTP to CHMOD config.php to 666.
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

FTP??

what mean?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

FTP... the protocol you *probably* use to upload your files to the server.

If you are hosting from your own machine then it's just a case of chaning the permissions for the file.

On unix it's simply:

Code: Select all

chmod 666 config.php
Via FTP you issue the same command but if you use an FTP program with a GUI like WS_FTP you right click the folder and choose CHMOD, then type 666 in the value field.

CHMOD is just the command for changing file permissions (i.e. read/write/execute) ;)
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

o ya i remember, i had one, then my pc went so i havnt got it back yet, where i can i get a free one untill i can get my old one back?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Free free free....

Open a command line and type the follwoing... you need to learn FTP command for that though.

Code: Select all

ftp
ftp> o servername.com
User: username
Password:
Welcome blah blah blah
ftp>
There's quite a few GUI ones too. WS_FTP has a free trial I believe.

A quick search in Google should provide some links (or a search fro "FTP" on http://www.download.com/) ;)
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

see filepermission of the file you wanna access, also check the folder/path:

<PATH>."/config.php";
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

im going to uplad all again, i think i could of missed somethings
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

ftp is not connecting Y? whats the host name?
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
See help/support of your webhosting company... (sometimes it's just your domainname, ftp.yourdomain.com or yourdomain.com, or some server address of the company userXY.companyname.com)

djot
-
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

thanks

fixed
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

more problem creaping up!!

Warning: Cannot modify header information - headers already sent by (output started at /home/gaogier/public_html/topsites2/config.php:55) in /home/gaogier/public_html/topsites2/out.php on line 68

here is hte line

Code: Select all

header(&quote;Location: &quote;.$url);
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

*yawn* Search :roll:

There must be at least 100 posts on this topic alone on this forum... look at lines above that one. If anything sends output back to the browser then the header can't be sent since headers come before page content.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

hey ma! we got a tutorial on this!

viewtopic.php?t=1157
Post Reply