PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

File upload submission gives PHP errors

  1. When submitting with an image attached via a file upload field, I get the following errors: It "submits" successfully, but with no image attached.

    Any thoughts or insights?

    Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-includes/functions.php on line 2104
    
    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-includes/functions.php on line 2095
    
    Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-includes/functions.php on line 2104
    
    Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-includes/functions.php on line 2104
    
    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-includes/functions.php on line 2095
    
    Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-includes/functions.php on line 2104
    
    Warning: copy(FAILED (Upload folder could not be created.)) [function.copy]: failed to open stream: No such file or directory in /nfs/c09/h04/mnt/140452/domains/productionlocations.com/html/wp-content/plugins/gravityforms/forms_model.php on line 1871
    Posted 12 years ago on Wednesday May 23, 2012 | Permalink
  2. David Peralty

    This isn't a Gravity Forms issue, but a server one. Check out this post for more details:
    http://www.mydigitallife.info/php-scripts-open_basedir-restriction-in-effect-error/

    Posted 12 years ago on Thursday May 24, 2012 | Permalink
  3. I have the same errors, after trying to change the upload-directory of a form.

    add_filter("gform_upload_path_2", "change_upload_path");
    function change_upload_path($path_info){
    $path_info["path"] = "/webcontent/wp-content/themes/vib/images/profielimages/";
    $path_info["url"] = get_bloginfo('stylesheet_directory')."/images/profielimages/";
    return $path_info;
    }
    I am confused of why I must give a "path" and a "url". I hardcoded the "path" because I was desperate (where does it begin - this "path"-entry and what is it used for?) The uploading was ok, before I wanted to change the path_name, so I was thinking that this was not a server problem. I DO want the images of this form to be located in this specific directory. Do you still think it is a server problem? The directory is already existing.

    Posted 12 years ago on Thursday May 24, 2012 | Permalink
  4. David Peralty

    It is a server permissions issue. Seems you are limited in where you are allowed to put files. Contact your web host regarding what you are trying to do and they should be able to help you.

    Posted 12 years ago on Thursday May 24, 2012 | Permalink
  5. Thanx David, I'll try. And can you give me any feedback on the code in my "change_upload_path"-function? Are the elements filled correctly ?

    Posted 12 years ago on Thursday May 24, 2012 | Permalink
  6. David Peralty

    I think you would want template_url instead of stylesheet_url for your bloginfo call, but otherwise it looks fine.

    Posted 12 years ago on Thursday May 24, 2012 | Permalink