Jump to content

Permission denied in Maxs image uploader

- - - - -

  • Please log in to reply
7 replies to this topic

#1
onething

onething

    Programmer

  • Members
  • PipPipPipPip
  • 118 posts
I-m trying to get this image script uploader to work on my site but Im getting this:


Warning: mkdir() [function.mkdir]: Permission denied in /home/admin/domains/mydomain.com/public_html/maxImageUpload.class.php on line 55


Warning: mkdir() [function.mkdir]: Permission denied in /home/admin/domains/mydomain.com/public_html/maxImageUpload.class.php on line 59


Warning: mkdir() [function.mkdir]: Permission denied in /home/admin/domains/mydomain.com/public_html/maxImageUpload.class.php on line 63

above the box.

Also, though it allows you to choose your file to upload, it doesnt give you the website its landed so I presume its not talking to the database on the server correctly.

However id be very happy if you could just solve the first issue for me, for the time being, to make it at least look good.

As its including the maximageupload.class.php, and the lines referred to from that file are these:

       $this->originalDir = $this->baseDir.DIRECTORY_SEPARATOR.$this->originalDir.DIRECTORY_SEPARATOR;

       if (!file_exists($this->originalDir)) {

          mkdir($this->originalDir);

       }

       $this->normalDir = $this->baseDir.DIRECTORY_SEPARATOR.$this->normalDir.DIRECTORY_SEPARATOR;

       if (!file_exists($this->normalDir)) {

          mkdir($this->normalDir);

       }

       $this->thumbDir = $this->baseDir.DIRECTORY_SEPARATOR.$this->thumbDir.DIRECTORY_SEPARATOR;

       if (!file_exists($this->thumbDir)) {

          mkdir($this->thumbDir);

The permissions denied are always the lines that say: mkdir($this->normalDir);

But scrolling up the file, these variables are just:

    // Directories to store images

    var $baseDir     = '';

    var $originalDir = 'original';

    var $normalDir   = 'normal';

    var $thumbDir    = 'thumbnail';

I was expecting somewhere to declare to this script that the file in question is referring to the new domain I-ve entitled the script to, but all i get are these variables, which dont say much to me.

#2
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
To upload (or create a folder) you need to have permission in this folder.
Are you on a dedicated server or a shared hosting server?
If you are on a dedicated, try changing the permission with chmod (chmod 774 theParentFolder)
If you are on a shared hosting server try to change the permission with your ftp client

#3
onething

onething

    Programmer

  • Members
  • PipPipPipPip
  • 118 posts
Thanks for your answer.

However, right now im trying to discover what SSH is exactly. I thought i could use filezilla client for this but obviously I must be wrong.

Entering chmod commands probably means its more like CLI interface...

#4
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
There's this Firefox add-on called FireConnect, if you're on Windows. You use the SSH command in a shell on Linux.

I don't know whether it's possible or not to upload or download files using SSH, though.

#5
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
ssh is simply a way to communicate with a distant computer like if you were directly on it. But with command line only.
A well know ssh client is putty: PuTTY: a free telnet/ssh client
Connect with the IP, than enter the username & password, and you are in your distant server

It is possible to send/download file throw ssh with the "scp" command, but it can be a little bit hard to understand

#6
onething

onething

    Programmer

  • Members
  • PipPipPipPip
  • 118 posts
Hey thanks for the recommendation, and i finally understood what was going on with the chmod failures. I wasnt updating the folder correctly.

However, some updates still wont work. Like when I tell the public html folder to go 777, it just reverts back to 774

However, I am now getting

Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 501 is not allowed to access /home/admin/domains/mydomain.com/public_html/mydomain.com owned by uid 48 in /home/admin/domains/mydomain.com/public_html/maxImageUpload.class.php on line 55


Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 501 is not allowed to access /home/admin/domains/mydomain.com/public_html/mydomain.com owned by uid 48 in /home/admin/domains/mydomain.com/public_html/maxImageUpload.class.php on line 59


Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 501 is not allowed to access /home/admin/domains/mydomain.com/public_html/mydomain.com owned by uid 48 in /home/admin/domains/mydomain.com/public_html/maxImageUpload.class.php on line 63

Ive tried messing around trying to give both the index.php full permissions, then the domain.com where its sitting at and which i interpret to be public html folder in the ftp scenario.

But now it just seems to have gotten even nuttier. **** image uploaders driving me nuts.

---------- Post added at 04:37 AM ---------- Previous post was at 04:14 AM ----------

Also my inability to understand why the home page gives:

setUploadLocation(getcwd().DIRECTORY_SEPARATOR); $myImageUpload->uploadImage(); ?> 

when its including the maximageupload class, is practically symbolic of m troubles with PHP, because nowhere in that class.php is a setuploadlocation declared for me to define. A setuploadbaselocation is declared, though, but thats no use to me.

Plus when the basedirupload is mentioned its not being defined but just a function thats occuring:

    function setUploadBaseLocation($dir){

        $this->baseDir = $dir;

    }

    

    function showUploadForm($msg='',$error=''){


#7
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
You have the safe mode activated in php.
This option can be nice to prevent some hack, but sometime can be a pain in the ***, and anyway it will be deprecated in php6.
So in your php.ini file add (or modify) the line safe_mode = Off

#8
onething

onething

    Programmer

  • Members
  • PipPipPipPip
  • 118 posts
Thanks! indeed in directadmin safemode is an easy thing to deactivate! that part of it is solved!

hey if anyone knows what setuploadlocation refers to gimme a shout¡




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users