WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Image upload error (yes I am pretty sure I checked all the chmod settings! (7 posts)

  1. OldeCrow
    Member
    Posted 7 years ago #

    Help!
    I'm not sure if this is "new" behavior as I didn't use the upload functions until after I updated to latest version! 2.2.1

    I do have 2.2 installed on another domain with the same hosting service and it doesn't have this problem.

    The files upload but then the upload section gets replaced with this error, and yes I get the gif file error that corrisponds to gif file uploads too!

    Warning: imagejpeg(): Unable to access /home/www/lcrwc/wp-content/secret/2007/07/image004.thumbnail.jpg in /home/www/lcrwc/wp-admin/admin-functions.php on line 2310

    Warning: imagejpeg(): Invalid filename '/home/www/lcrwc/wp-content/secret/2007/07/image004.thumbnail.jpg' in /home/www/lcrwc/wp-admin/admin-functions.php on line 2310

    Warning: Cannot modify header information - headers already sent by (output started at /home/www/lcrwc/wp-admin/admin-functions.php:2310) in /home/www/lcrwc/wp-includes/pluggable.php on line 331

  2. OldeCrow
    Member
    Posted 7 years ago #

    FIXED IT MYSELF!
    Closer inspection revealed a difference in my php.ini files from the sites that were working and the site that was not!

    old php.ini

    register_globals = on
    include_path = ".:/usr/local/php/share/pear"
    zend_optimizer.optimization_level=15
    zend_extension="/usr/local/lib/ZendOptimizer.so_4.4.x"

    new php.ini (file uploads working)(notice save mode off and memory limits)

    register_globals = on
    include_path = ".:/usr/local/php/share/pear"
    safe_mode = off
    memory_limit = 16m
    zend_optimizer.optimization_level=15
    zend_extension="/usr/local/lib/ZendOptimizer.so_4.4.x"

    No need to thank me just send me a dollar if you find it usefull!

    Guess that means someone will have to change the documentation to say "There are no problems with safe mode... er...um... except for one ;)

  3. erika_conn
    Member
    Posted 6 years ago #

    OK, you got me. What's a php.ini file? Where do I find it?

    I can't upload image files in Admin. I get this message:

    The uploaded file could not be moved to /home/cecon46/public_html/whatsmellssogood/wp-content.
    Warning: Cannot modify header information - headers already sent by (output started at /home/cecon46/public_html/whatsmellssogood/wp-admin/admin-functions.php:1986) in /home/cecon46/public_html/whatsmellssogood/wp-includes/functions.php on line 1357

    I don't know what the hell that means.
    These are the specs on my host:
    Operating system Linux
    Service Status Click to View
    Kernel version 2.4.20-20.9smp
    Machine Type i686
    Apache version 1.3.34 (Unix)
    PERL version 5.8.7
    Path to PERL /usr/bin/perl
    Path to sendmail /usr/sbin/sendmail
    Installed Perl Modules Click to View
    PHP version 4.3.11
    MySQL version 4.1.22-standard
    cPanel Version 11.4.6-RELEASE 13580
    Theme cPanel X v2.6.0
    Documentation Click to View

    It's Ok. So what's the problem? Nobody seems to help me and I thought I was getting close with your help but then I couldn't figure out where to see php.ini.

    Can you help me? Oh, I have 2.2.2

  4. ClaytonJames
    Member
    Posted 6 years ago #

    If I am not mistaken, php.ini is a server side configuration file with a general location (in a Linux distribution), of;

    /etc/php.ini, or maybe /etc/php(version)/php.ini, depending on the distro.

    I don't believe you would have access to this unless you own the server on which your site is hosted. You may want to contact your hosting service and see if something has been changed recently.

  5. erika_conn
    Member
    Posted 6 years ago #

    Oh, I wish I'd known that before. My host has been screwing up this last little while - and I just finished paying for another year.

    Thanks for the info.

  6. wireless
    Member
    Posted 6 years ago #

    Did you know you can create your own php.ini file using notepad/notepad++.
    All you need to do is
    1 open notepad or something similar
    2)paste/copy the relevant code needed to put in it.
    3)Save it as php.ini
    4)upload it into your root directory.
    5)you have a php.ini file on your server
    easy.....

  7. Jason000
    Member
    Posted 6 years ago #

    Another solution is to 'touch' the file before calling imagejpeg. Edit flexible-upload.php like so:

    $jpegquality = get_option(FUP_JPEG_QUALITY_OPTION);
    $jpegquality = $jpegquality ? $jpegquality : 75;
    touch($thumbpath); // add this line
    if (!imagejpeg( $thumbnail, $thumbpath, $jpegquality )) {
      $error = __( "Thumbnail path invalid", 'fup' );
    }

    Add a similiar line before other imagejpeg, imagegif, and imagepng calls.

Topic Closed

This topic has been closed to new replies.

About this Topic