Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

bibutils installation problem

Help
pod-o-mart
2009-12-18
2013-05-28
  • pod-o-mart
    pod-o-mart
    2009-12-18

    Hi

    I have installed bibutils in a subfolder of my refbase installation and altered the mysql database according to http://www.refbase.net/index.php/Bibutils. However, I get following error message when I try to import a bibtex file:

    > Warning: tempnam() :
    > open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the
    > allowed path(s):
    > (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 157
    >
    > Warning: fwrite(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 159
    >
    > Warning: fclose(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 160
    >
    > Warning: tempnam() :
    > open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the
    > allowed path(s):
    > (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 115
    >
    > Warning: tempnam() :
    > open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the
    > allowed path(s):
    > (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 157
    >
    > Warning: fclose(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 160
    >
    > Warning: tempnam() :
    > open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the
    > allowed path(s):
    > (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php
    > on line 115
    >
    > Warning: Cannot modify header
    > information - headers already sent by
    > (output started at
    > /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php:157)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/bib/import_modify.php
    > on line 557

    There are similar error messages with other formats.

    In addition, RIS alway says:

    > Record 1: Unrecognized data format!
    > Required field missing: TY

    Import works with all records except the first when I check

    > Skip records with unrecognized data
    > format

    Maybe someone  has an idea how to solve this?

    My server:
    PHP Version 5.2.4
    The php.ini is according to http://www.refbase.net/index.php/Required_PHP-INI_Settings.
    safe_mode master:on local:off

    Thank you in advance!

    Martin

     
  • Hi Martin,

    > I get following error message when I try to import a bibtex file:

    > Warning: tempnam() : open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the allowed path(s): (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in /var/www/vhosts/podolak.net/httpdocs/bib/includes/execute.inc.php on line 115

    If save mode is on, please make sure that Bibutils has been installed at a path that's in the 'open_basedir' path.

    This topic was also discussed in an , which may provide some further insights.

    : https://sourceforge.net/projects/refbase/forums/forum/218758/topic/2626609

    Quotes from that thread:

        If you still have this setting in file 'initialize/ini.inc.php':

        $sessionTempDir = session_save_path();

        try setting the variable to an explicit path, e.g.:

        $sessionTempDir = "/home/ginas5/phptmp/";

        Note that the above example assumes that you have a PHP session directory (named 'phptmp')
        within the root folder of your account. Your 'open_basedir' mentions '/tmp' so you could try this as
        well. If you don't know the path to your account's session directory, please contact your provider,
        they should be able to tell you the correct path.

        So, in summary, I believe there are (at least) two issues here:
       
        1) If 'safe_mode' is enabled on your server, you'll need to put the bibutils programs into the
            directory given in 'safe_mode_exec_dir'.
       
        2) You'll need to set the path to your session directory correctly in variable '$sessionTempDir'.

    In your case, the path spec might just read:

        $sessionTempDir = "/tmp/"; // note the trailing slash

    > In addition, RIS alway says:
    >
    > > Record 1: Unrecognized data format! Required field missing: TY
    >
    > Import works with all records except the first when I check
    >
    > > Skip records with unrecognized data format

    This sounds very similar to a problem that come up just recenmtly in the forums. Please see .

    : https://sourceforge.net/projects/refbase/forums/forum/218758/topic/3483874?message=7885467

    HTH, Matthias

     
  • pod-o-mart
    pod-o-mart
    2009-12-20

    Hi Mathias,

    Thank you for your reply.

    I could solve the problem with "Record 1: Unrecognized data format! Required field missing: TY". As you described in the other message I just had to resave the RIS file to UTF-8 without BOM before importing.

    Export still doesn't work, I get chased by php error messages followed by blank pages whatever I do.

    When I change $sessionTempDir to a /tmp/ directory I get following error:

    > Parse error: syntax error, unexpected
    > T_VAR in
    > /var/www/vhosts/podolak.net/httpdocs/lib/initialize/ini.inc.php
    > on line 441

    There must be some other problem, I guess something with the server config. When tried to install refbase with install.php there occurred already a bunch of "open_basedir restriction in effect" errors, so I ignored it and installed manually.

    When I try to export a record to RIS or other formats I anyways get this message:

    > Warning: tempnam() :
    > open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the
    > allowed path(s):
    > (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php
    > on line 157
    >
    > Warning: fwrite(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php
    > on line 159
    >
    > Warning: fclose(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php
    > on line 160
    >
    > Warning: tempnam() :
    > open_basedir restriction in effect.
    > File(/var/lib/php5) is not within the
    > allowed path(s):
    > (/var/www/vhosts/podolak.net/httpdocs:/tmp)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php
    > on line 115
    >
    > Warning: Cannot modify header
    > information - headers already sent by
    > (output started at
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php:157)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/include.inc.php
    > on line 5150
    >
    > Warning: Cannot modify header
    > information - headers already sent by
    > (output started at
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php:157)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/lib/search.php
    > on line 1818

    RIS export should work even without bibutils as I understood it. Export works with all XML though except WordXML.

    Thank you for helping, refbase is a really good thing and I can't wait for that it works on my server.

    Martin

     
  • Hi Martin,

    > I could solve the problem with "Record 1: Unrecognized data format! Required
    > field missing: TY". As you described in the other message I just had to resave
    > the RIS file to UTF-8 without BOM before importing.

    Glad that this worked for you!

    > Export still doesn't work, I get chased by php error messages followed by blank pages whatever I do.

    > When I change $sessionTempDir to a /tmp/ directory I get following error:

    > > Parse error: syntax error, unexpected T_VAR in /var/www/vhosts/podolak.net/httpdocs/lib/initialize/ini.inc.php on line 441

    This sounds as if some variable in file 'ini.inc.php' lacks a trailing semicolon (";") or something similar. Please make sure that you've included the semicolon at the end of the variable definition:

        $sessionTempDir = "/tmp/";

    Also, did you do any other modifications in 'ini.inc.php'? If so, please check these modifications as well.

    > RIS export should work even without bibutils as I understood it.

    For import, yes. But for export, RIS also requires Bibutils ().

    : http://www.refbase.net/index.php/Bibutils#refbase_integration_with_Bibutils

    > Export works with all XML though except WordXML.

    The Word 2007 XML export feature is also provided via Bibutils.

    Regards, Matthias

     
  • pod-o-mart
    pod-o-mart
    2009-12-21

    Hi Mathias

    Yes, there were some errors in ini.inc.php (wrrong paths).

    Now I get following message when trying to export:

    > Warning: fwrite(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php
    > on line 159
    >
    > Warning: fclose(): supplied argument
    > is not a valid stream resource in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php
    > on line 160
    >
    > Warning: Cannot modify header
    > information - headers already sent by
    > (output started at
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php:159)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/include.inc.php
    > on line 5150
    >
    > Warning: Cannot modify header
    > information - headers already sent by
    > (output started at
    > /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php:159)
    > in
    > /var/www/vhosts/podolak.net/httpdocs/lib/search.php
    > on line 1818

    Safe_mode local value is OFF, master value is ON, I guess the local value is enough.

    /usr/bin/bibutils/ is set on CHMOD 750 and its files on 755. Owner is root/root.

    Else refbase works fine.

    Martin

     
  • I believe your directories do not have appropriate ownership/permissions.

    If the bibutils directory is 750 & owned by root:root, then only root will be able to transverse the directory and use the programs in that directory (and your web server should not be run by root).

    However, what are the ownership/permissions of your php session temporary directory?  Your error could be caused if your web server account can't write the temporary file.

    Where are you checking the local value of safemode?  This is directory-dependent, so you must check it in the same directory as scripts that work better if safemode is off.

     
  • pod-o-mart
    pod-o-mart
    2009-12-22

    Temp directory is /tmp/ 777 root:root

    I made an error:
    in /var/www/vhosts/podolak.net/httpdocs/lib/ safe mode is OFF, but in /usr/bin/bibutils/ it was ON. So I now moved it to the safe_mode_exec_dir which I defined to be /usr/bin/safe_mode_exec_dir. The dir has 755 root:root.

    The errors remain when trying to use bibutils on refbase.

     
  • Are you sure that /tmp/ is your php session temporary directory?  Do you have any other restrictions in place that would prevent writing to it?  You can try modifying /var/www/vhosts/podolak.net/httpdocs/lib/includes/execute.inc.php on line 159 to temporarily write to a single, static file in a location you know you have write access to (such as your files subdirectory assuming file uploads work).

     
  • pod-o-mart
    pod-o-mart
    2009-12-22

    Hi Mathias and karnesky,

    Thank you for your patience. I have solved the problem, everything works now as it should.

    The name of $sessionTempDir was wrong, as the php session temporary directory. The session directory that is declared in php.ini doesn't work either, I simply use a temp directory in refbase and it works great.

    Thank you for your support!

    Martin

     
  • Hi Martin,

    > I have solved the problem, everything works now as it should.

    That's great to hear!

    Out of curiosity, I just checked  (which looks nice, btw), and I noticed that the BibTeX/RIS/Endnote export still generates a blank file, though.

    : http://podolak.net/de/studium-russlandseiten/literatur

    Matthias

     
  • pod-o-mart
    pod-o-mart
    2009-12-23

    Hi Mathias,

    I've only checked if the error messages have disappeared and if the download starts. Thank you for indicating the error.

    I don't have an idea where to look for this error. I tried to chmod the files to 777 and to change ownership of the tmp file but nothing has changed.

     
  • I realize I'm bumping a very old thread, but I just checked in code that will remove BOMs from uploaded files, if present.  RefWorks & some other providers include BOM by default.