Page 1 of 1

ftp_mkdir Permission Denied

Posted: Mon Feb 08, 2010 5:08 am
by tamamk
Hi,

I have a test server which I could FTP to using any program with the user "webadmin". Once logged in, I could add, delete, rename directories as I wish.

In my PHP application, I successfully connect to the server with the same username, however, it won't allow the creation of any directory.

Here is the test code:

Code: Select all

 
$ftp_host = 'localhost';
$ftp_user = 'webadmin';
$ftp_password = 'asdf123';
 
$conn_id = ftp_connect($ftp_host, 21) or die ("Cannot connect to ftp_host");
 
ftp_login($conn_id, $ftp_user, $ftp_password) or die("Cannot login");
 
ftp_mkdir($conn_id, "/path_to_folder/testing") or die("Couldn't create the directory");
 
ftp_close($conn_id);
 
The above returns me Permission denied. The same code on Prod is functional.

PS: All files on the test server are owned by "webadmin" and have 775 permission (even 777 won't work).

Any thoughts?

Re: ftp_mkdir Permission Denied

Posted: Mon Feb 08, 2010 9:17 am
by klevis miho
Tried to contact the support?

Re: ftp_mkdir Permission Denied

Posted: Mon Feb 08, 2010 3:56 pm
by tamamk
lol sorry that sounded funny...the server is mine and I'm the only PHP expert at the place.

I'm wondering if it has something to do with the FTP server itself?

If SFTP is required, would this hurdle the functionality of ftp_mkdir? If so, what to do?