Log in

View Full Version : Resolved haha?



bluewalrus
12-17-2008, 12:18 AM
So I made this script and got it to make a directory and then another directory inside that one. It's not writing in the permissions I want it to its writing it as 755 as opposed to 777 that I want . Anyways that's not the big problem... The big problem is now my ftp is telling me I don't have persmission to delete the files it wrote. haha? This is my ftp output and below that my php code. Thanks for any help you can offer. Don't know if this is actually the php or just an ftp/ server problem.


19:13:28 Status: Retrieving directory listing...
19:13:28 Command: PASV
19:13:28 Response: 227 Entering Passive Mode (76,163,112,2,134,233).
19:13:28 Command: LIST
19:13:28 Response: 150 Opening ASCII mode data connection for file list
19:13:28 Response: 226 Transfer complete
19:13:28 Status: Directory listing successful
19:13:42 Status: Set permissions of '/bluewalrus.net/travelreports/fff2/images' to '777'
19:13:42 Command: SITE CHMOD 777 images
19:13:42 Response: 550 CHMOD 777 images: Operation not permitted
19:13:45 Command: RMD images
19:13:45 Response: 550 images: Permission denied
19:13:46 Status: Retrieving directory listing...
19:13:46 Command: PASV
19:13:46 Response: 227 Entering Passive Mode (76,163,112,2,206,124).
19:13:46 Command: LIST
19:13:46 Response: 150 Opening ASCII mode data connection for file list
19:13:46 Response: 226 Transfer complete
19:13:46 Status: Directory listing successful


<?php
$filename = $_POST['files'];
$filesgo = 'travelreports/' . $filename;
mkdir($filesgo, 0777);
$filesin = $filesgo . "/images";
mkdir($filesin, 0777);
?>

thetestingsite
12-17-2008, 01:43 AM
It sounds like it is actually a permissions issue (owner that is). I believe that the php script created the folders using the webserver user (usually www-data or equivalent) instead of the username that you are using when logging into ftp. What you may want to try to use is chown (http://www/php.net/chown) to change the owner of the folders to what you are using in your ftp program. You could also ask your host for support on this as far as finding out what user/group to use for all the folders.

Hope this helps.

bluewalrus
12-17-2008, 04:48 AM
Yea contacting the server was needed. Had to change the permissions you were right. Here's what they said though in case someone else is searching...


You have this issue because you created a folder through php. Our PHP works as apache module. And httpd is apache user. So all files and folders that were created or changed by apache would have httpd as owner. To restore your default owner you should enter your control panel->FTP service->Enable FTP for one of your domain (if you have all turned off)->click edit button and add virtual ftp directory where you have wrong owner for your files. For example yourdomain.com/ After this you will be able to change or delete this files.