ftp_mkdir Permission Denied

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

Post Reply
tamamk
Forum Commoner
Posts: 25
Joined: Sun Aug 24, 2008 3:37 am

ftp_mkdir Permission Denied

Post 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?
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: ftp_mkdir Permission Denied

Post by klevis miho »

Tried to contact the support?
tamamk
Forum Commoner
Posts: 25
Joined: Sun Aug 24, 2008 3:37 am

Re: ftp_mkdir Permission Denied

Post 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?
Post Reply