• Resolved mgadala

    (@mgadala)


    Everything was working fine for a while and then out of the blue the contact form starting giving an error with file uploads with this error:

    “Failed to upload file.”

    and the following under the contact form send button:

    “Validation errors occurred. Please confirm the fields and submit it again.”

    We’re running the latest version of Contact Form 7 and I’ve already checked the following things:

    – The wpcf7_uploads folder exists and is writable (as well as uploads folder)
    – changed the default folder to something else using wp-config

    Both failed to eliminate the error.

    Please help 🙂

    Thanks,

    https://wordpress.org/plugins/contact-form-7/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Check your PHP error log.

    Thread Starter mgadala

    (@mgadala)

    Hey Takauki,

    I found a MONSTER error log from yesterday (4.7GB) and it was the same line repeated thousands of times

    [Thu Aug 20 14:00:53 2015] [error] [client 207.244.181.219] PHP Warning: is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/cbdglass.com/httpdocs:/tmp) in /var/www/vhosts/cbdglass.com/httpdocs/wp-includes/functions.php on line 1501, referer: http://www.cbdglass.com/wp-admin/admin.php?page=wpcf7-new&locale=en_US

    Please let me know

    Thanks,
    Mark

    Thread Starter mgadala

    (@mgadala)

    Also,

    Her is what I found in functions.php line 1501:

    // We need to find the permissions of the parent folder that exists and inherit that.
    	$target_parent = dirname( $target );
    	while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
    		$target_parent = dirname( $target_parent );
    	}
    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Which version of PHP do you use?

    Thread Starter mgadala

    (@mgadala)

    PHP Version 5.2.6

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Wow. Is there any reason to keep such an outdated version?

    Do you use the PHP in safe mode?

    Thread Starter mgadala

    (@mgadala)

    I think it is just an old server, I just requested to have the PHP updated on the server.

    Also, PHP is not in safe mode.

    Do you think that running this outdated version of PHP is what’s causing the issue? (this issue began right after we updated the site’s WordPress/plugins afer not having an update in a few years)

    Thanks,
    Mark

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I don’t think the outdated PHP version is the only cause of this issue, but might be connected somehow.

    See How your uploaded files are managed

    I’m guessing that something has changed the temporary folder path. For testing try setting the WPCF7_UPLOADS_TMP_DIR constant explicitly as it should override other settings.

    Thread Starter mgadala

    (@mgadala)

    Hey Takayuki,

    I requested an update for the PHP from our server admins, I also tested changing the temp folder path and it unfortunately did not work either.

    Any other suggestions?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Are you still seeing the same PHP error log?

    Thread Starter mgadala

    (@mgadala)

    Hey Takayuki,

    After moving to a new server with PHP 5.5 installed the error disappeared and the form seems to be working correctly with uploads.

    Thanks very much for your insight and help!

    Best,
    Mark

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Failed to Upload Files – Validation Errors Occurred’ is closed to new replies.