Page 1 of 1

No way to Chmod.

Posted: Mon Jul 07, 2003 8:14 pm
by Owe Blomqvist
Hi.
I have this issue with chmod.
the webserver says "permission denied" after i chmod a directory i created with ftp_mkdir( );

The website is on a webhotel with php 4, mysql and it uses Linux and apache.
Basicly what i do is this:

Code: Select all

<?php
$ftp_con = ftp_connect( FTP_HOST, FTP_PORT );

if( ftp_login( $ftp_con, FTP_USER, FTP_PASS ) )
    {
        if( ftp_mkdir( $ftp_con, "/public_html/users/owe" ) )
            {
                chmod("/home/owe/public_html/users/owe", 0777);
            }
    }
ftp_nclose = ftp_quit( $ftp_con );
?>
It creates the folder allright, but the chmod command returns:
Operation not permitted in /home/owe/public_html/test/ftp.php

I have allso tried to use ftp_exec(), but it returns:
SITE EXEC is an unknown extension in /home/owe/public_html/test/ftp.php

If somebody knows how to deal with this, please help me out.
Allso, Why isn´t there a ftp_chmod( "ftp_connection", "chmod" ) function?
Regards,
Owe Blomqvist

Posted: Mon Jul 07, 2003 8:22 pm
by m3rajk
i know this is basic, but find out how it makes it. are you the owner of the directory?

Posted: Mon Jul 07, 2003 8:29 pm
by Owe Blomqvist
Yes i´m the owner.
As far as i can see, chmod() uses the anonymous web browsing account, which in my case is called "nobody", And not the ftp account which is the owner account. Please correct me if i´m wrong about this.

I´m a bit buffed over the lack of a ftp_chmod( "ftp_connection", "file", "chmod" ) function.

Regards,
Owe Blomqvist

Posted: Tue Jul 08, 2003 9:58 am
by Owe Blomqvist
Please.
Somebody has to know something about this.
People succesfuly use chmod all over the forum.
I´ve spent the whole day figuring out how to do it, without using Cute FTP.

Posted: Tue Jul 08, 2003 10:36 am
by Judas
Do you have TELNET acces to the ftp dir. ?

Posted: Tue Jul 08, 2003 12:57 pm
by Owe Blomqvist
No.
I´m sorry, No Telnet.
I don´t know if this matters, but this is the directory structure i see upon connecting to the host by using cuteftp:

etc
mail
public_ftp
public_html
<------ this is where the homepage resides. And where i try to create the user directories.
tmp
www
<------ same folder as public_html( ? )

Thanks for trying to help me out.
Regards,
Owe Blomqvist.