WordPress.org

Forums

Really Simple CAPTCHA
[resolved] Unable to open [image] for writing (9 posts)

  1. gilu
    Member
    Posted 3 years ago #

    I have tried everything, short of modifying code.
    I've deleted the directory and let the plugin re-create it. No cigar!
    I did deactivate any caching plugin.

    Funniest thing is, these messages appear at random!

    Warning: imagepng() [function.imagepng]: Unable to open '/home/.../html/WP/wp-content/uploads/wpcf7_captcha/1746827751.png' for writing: Permission denied in /home/.../html/WP/wp-content/plugins/really-simple-captcha/really-simple-captcha.php on line 127
    
    Warning: fopen(/home/.../html/WP/wp-content/uploads/wpcf7_captcha/1746827751.txt) [function.fopen]: failed to open stream: Permission denied in /home/.../html/WP/wp-content/plugins/really-simple-captcha/really-simple-captcha.php on line 147

    After deleting the whole temp folder, it shows no error message and creates all the images effortlessly.

    Any ideas?
    Thanks!

    http://wordpress.org/extend/plugins/really-simple-captcha/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    Do you use the latest version of the plugin?

  3. gilu
    Member
    Posted 3 years ago #

    I'd say yes.
    Readme.txt: Stable tag: 1.5
    really-simple-captcha.php: Version: 1.5

  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    Maybe it's not the latest version (1.5). Because there is no imagepng() at really-simple-captcha.php line 127 and no fopen() at really-simple-captcha.php line 147 in the version. Try reinstalling it.

  5. gilu
    Member
    Posted 3 years ago #

    Weird...
    I just re-installed (deactivated, deleted and re-installed) it.
    And in line 126 there is still "imagepng"!

    From the Really Simple CAPTCHA.php file:

    Author: Takayuki Miyoshi
    Version: 1.5
    Author URI: http://ideasilo.wordpress.com/

    switch ( $this->img_type ) {
    case 'jpeg':
    $filename = sanitize_file_name( $prefix . '.jpeg' );
    imagejpeg( $im, $dir . $filename );
    break;
    case 'gif':
    $filename = sanitize_file_name( $prefix . '.gif' );
    imagegif( $im, $dir . $filename );
    break;
    case 'png':
    default:
    $filename = sanitize_file_name( $prefix . '.png' );
    imagepng( $im, $dir . $filename );
    }

    Line #144
    if ( $fh = fopen( $answer_file, 'w' ) ) {

    This is the version I've downloaded from my admin panel...??
    Do you have something else?

  6. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, Really Simple CAPTCHA 1.5 surely has imagepng() at line 126 and fopen() at line 144. But note that what your error message showed was different.

    Warning: imagepng() [function.imagepng]: Unable to open '/home/.../html/WP/wp-content/uploads/wpcf7_captcha/1746827751.png' for writing: Permission denied in /home/.../html/WP/wp-content/plugins/really-simple-captcha/really-simple-captcha.php on line 127

    Warning: fopen(/home/.../html/WP/wp-content/uploads/wpcf7_captcha/1746827751.txt) [function.fopen]: failed to open stream: Permission denied in /home/.../html/WP/wp-content/plugins/really-simple-captcha/really-simple-captcha.php on line 147

  7. gilu
    Member
    Posted 3 years ago #

    Ok now ... I've added an extra line with characters on top... that's why all the line numbers moved by one or two. ;) Should've told you that sooner.

  8. gilu
    Member
    Posted 2 years ago #

    So, any idea to as why it does that? Any way to fix this?
    No matter what linenumber of code...

    Google for "wpcf7_captcha failed to open stream" and I've gotten more than 1000 results back...

    Thanks.

  9. gilu
    Member
    Posted 2 years ago #

    I think I got it:

    Change in really-simple-captcha.php these two lines from whatever it was to 0664.
    0664 = read-write by owner and group, read by others

    /* Mode of temporary image files */
    $this->file_mode = 0644;
    
    /* Mode of temporary answer text files */
    $this->answer_file_mode = 0644;

    So far, no error message!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Really Simple CAPTCHA
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic