4 Replies Latest reply on Mar 3, 2010 7:06 PM by budeborton

    Image Uploads with PHP 5.3

    budeborton Level 1

      In do my own internal tests with PHP 5.3, I have encountered a problem with Image uploads and ADDT.


      Error message:

      Developer Details:

      tNG_multipleInsert error.
      An error occurred while inserting the records. (MINS_ERROR)
      Image upload error. Error resizing image: Error converting image (image resize). The "" folder has no write permissions. (IMG_RESIZE)


      PLEASE NOTE: The folder DOES have the correct write permissions. This exact same page works perfectly when I route the test site through PHP 5.2.x. Only when I use PHP 5.3 does this error occur.


      You will notice that is says "The "" folder etc....". When listing the folder name, it appears to be looking at "root" or it is not getting a folder name properly.

      I have exhausted all of my options, includes the PHP 5.3 ini file - temporary upload directory setting which is discussed in another post for this error.


      Does anybody have ADDT running on 5.3 with successful image uploads?

      Any suggestions?


      (NOTE: I am not fixing these problems to build new sites with the outdated ADDT. I am simply making sure current sites will continue to work if my client(s) hosting company's upgrade)

        • 1. Re: Image Uploads with PHP 5.3
          budeborton Level 1

          First: Sorry for such poor grammar on my first post. Where is the "edit" button on new posts ?


          I wanted to add, this only occurs when a re-size is taking place. If I remove the resize feature of the image upload - it will upload fine to the correct folder. It will also overwrite on an update. Therefore, I believe the problem lays in the "resize" scripts somewhere.


          Although not confirmed, I suspect this will also occur on "show dynamic thumbnail". (EDIT: Confirmed to have the same problem)

          • 2. Re: Image Uploads with PHP 5.3
            budeborton Level 1

            This issue was resolved! Turns out I had a corrupt file on the test site. I updated the includes folder and it started working. That doesn't explain to me why it worked with PHP 5.2.11 and not 5.3 - but it works




            Another update, just in case others come across this problem.


            I had followed instructions found on these  forums, to replace "split" with "preg_split". Not realizing (actually, just not thinking) that preg uses a different regex engine, so not only do the functions change, but so do the expressions.


            The file causing my problem was "includes/common/lib/image/KT_Image.class.php" on about line 2034.

            I had "preg_split" calling the original regex statement. I changed the regex statement and now everything works as it should.


            Original Line: $arr = split("[\/]", $path);

            New Line: $arr = preg_split("_[\\\\/]_", $path);

            • 3. Re: Image Uploads with PHP 5.3

              You just saved my life!!


              Thank you so much for posting this.

              • 4. Re: Image Uploads with PHP 5.3
                budeborton Level 1

                That's great to hear!

                I've benefited from so many other solutions on these forums, I'm glad I was able to help out for a change.