HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Problem with pictures (avatars and uploads)

nkkkonkkko New
edited December 2013 in Vanilla 2.0 - 2.8

Hi,

after some time I decided to give a chance to Vanilla but it is just giving me a headache.

Could you help me with this debug output:
filesize(): open_basedir restriction in effect. File(/var/www/utt/tmp/php9VrClC) is not within the allowed path(s): (/var/www/utt/html) ## /var/www/utt/html/forum/library/core/class.upload.php(305) #0 [internal function]: Gdn_ErrorHandler(2, 'filesize(): ope...', '/var/www/utt/ht...', 305, Array) #1 /var/www/utt/html/forum/library/core/class.upload.php(305): filesize('/var/www/utt/tm...') #2 /var/www/utt/html/forum/library/core/class.uploadimage.php(70): Gdn_Upload->ValidateUpload('Picture', true) #3 /var/www/utt/html/forum/applications/dashboard/controllers/class.profilecontroller.php(648): Gdn_UploadImage->ValidateUpload('Picture') #4 [internal function]: ProfileController->Picture('', '', '1') #5 /var/www/utt/html/forum/library/core/class.dispatcher.php(350): call_user_func_array(Array, Array) #6 /var/www/utt/html/forum/index.php(46): Gdn_Dispatcher->Dispatch() #7 {main}

I also have problem with FileUpload plugin which is correctly linking uploaded files but thumbnail or icon isn't shown, and if I look at the img link it has "/forum/forum/" in it. Obviously forum is located at var/www/forum/

loaded php.ini has open_basedir set to none. .htaccess base url is /forum, what else?

Thank you very much and happy new year,
Nikola

«13456

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    Hi, what version of fileupload are you using ? This has come up before there should be a fix for this , may have to do with the php version you are running , what numerical version of vanilla are you using ?

    hgtonight
  • In php.ini, open_basedir should be set to Off instead of "none." After making changes to the php.ini file, you have to restart Apache or the PHP service for the changes to take effect.

    Add Pages to Vanilla with the Basic Pages app

    vrijvlinderhgtonight
  • Hi,

    Shadowdare I have set it to Off and restarted httpd but nothing happened.

    vrijvlinder my php is v.5.3.3 and FileUpload is 1.7.1 as 1.8. wasn't working on mine 2.1b2.

    This problems could be or aren't related, hard to tell with my limited knowledge.

    Thanks for help,
    Nikola

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Can you try to update the php to 5.4 ?

    To switch to PHP 5.4 you can add this line to your htaccess file:

    AddHandler application/x-httpd-php54 .php .php5 .php4 .php3

    Or ask the host to upgrade it for you if possible. Hope this helps.

    hgtonight
  • ShadowdareShadowdare r_j MVP
    edited December 2013

    There might be a open_basedir setting that is being loaded up in httpd.conf before the php.ini file. In the httpd.conf file for Apache, commonly located in the /etc/httpd/ directory, search for a line that says php_admin_value open_basedir and set it to none if it exists (php_admin_value open_basedir none), then restart httpd again.

    Add Pages to Vanilla with the Basic Pages app

    vrijvlindernkkkohgtonight
  • Nothing there, I have even tried setting the dir but to na avail.

  • ShadowdareShadowdare r_j MVP
    edited December 2013

    Is safe_mode disabled in php.ini? One file on the system has got to be restricting open_basedir. Perhaps adding the directory /var/www/utt/tmp/ to the open_basedir list may work.

    Add Pages to Vanilla with the Basic Pages app

    vrijvlindernkkkohgtonight
  • Nothing again, not sure what else is there to do. If it's not obvious I will give up. I have added NoAvatar plugin and solved the thumbnail issue with FileUpload by adding a new folder substructure and file.png on a location where the script is looking for it. :)

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Do you have a folder for User Pics ?

    hgtonight
  • Hi,

    I have gone through the previous posts here, and I have tried both with and without dir (755 and 777)... didn't help.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    Ok can you add this file to your forum directory to get more info about your php. Once you decompress de folder upload the file to your directory then go to the files url and take a screenshot of the results. or give the link to see.

    nkkkohgtonight
  • Thank you for not giving up on me vrijvlinder!!! :)

    The problem was blindingly stupid, vhosts use different php.ini so all changes I did in etc/php.ini didn't reflect for real as vhost had separate php.ini config file (e.g. /var/www/vhosts/domain.com/etc/php.ini)

    Thank you all once again for your time!

    Happy New Year! :)

    vrijvlinderhgtonight
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You are very Welcome ! and Happy New Year! to you too !! :)

  • Just to clear my last message a little bit for future. Obviously problem was in open_basedir which was set lower than temp dir.

    I was checking php config in shell with php -i which reflected /etc/php.ini and not vhost php.ini so I was convinced that everything is ok there. :)

    vrijvlinderhgtonight
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    Did the file I give you help to find this out ? or how did you figure it out ? Besides the fact that shadowdare said where to make the changes but you made them in the wrong place right?

    just curious because open_basedir is set to no value in mine but I am not on a v host setup.

  • After I've created phpinfo.php I was unable to run it through browser and while figuring this out (expose_php) I have found that there is alternative php.ini which didn't show even with php --ini

    vrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    Don't know why it would not run, that is odd however if that helped you find the missing link then so be it, glad you got it going in any event :)

    here is more info on ini configurations

    http://www.php.net/manual/en/ini.core.php

  • Because expose_php was Off in vhosts php.ini :)

    vrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Ah ! ok I get it now, you could not run the file because expose php was off. Sorry I am a bit slow today.... then you ran the file and discovered the ini motherload ?

    I am just a stickler for clear steps to take in case someone else asks the same question. Some people even ask for step by step so the closest you can get to that would help such people.

    So to summarize, if you are having these problems, inspect your php ini settings and correct them in the proper file once you are sure that is the right file.

  • meshugymeshugy Musician/Hacker ✭✭

    @nkkko

    Nothing again, not sure what else is there to do. If it's not obvious I will give up. I have added NoAvatar plugin and solved the thumbnail issue with FileUpload by adding a new folder substructure and file.png on a location where the script is looking for it. :)

    I have a similar problem. Avatar images are fine, but I can't seem to get thumbnails to work for uploaded attachments. The Fileupload plugin correctly uploads the attachment to forum/uploads/FileUpload

    But when I look in forum/uploads/thumbnails/FileUpload there is no thumbnail

    I checked and open_basedir has a value of "none."

    You mentioned that you added a new folder and it worked. Were did you put the folder?

Sign In or Register to comment.