Koozali.org: home of the SME Server

gallery 2.3 problems

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
gallery 2.3 problems
« on: November 04, 2008, 07:21:32 PM »
i get problem upgrading and also installing a new gallery with version 2.3

Code: [Select]
Error (ERROR_BAD_PATH) : "/usr/bin/ffmpeg" is not specified in open_basedir.

    * in modules/ffmpeg/classes/FfmpegToolkitHelper.class at line 191 (gallerycoreapi::error)
    * in modules/ffmpeg/classes/FfmpegToolkitHelper.class at line 52 (ffmpegtoolkithelper::testbinary)
    * in modules/ffmpeg/module.inc at line 211 (ffmpegtoolkithelper::getoperationsandproperties)
    * in modules/core/PluginCallback.inc at line 180 (ffmpegmodule::activate)
    * in modules/core/PluginCallback.inc at line 67 (plugincallbackview::handlecallback)
    * in main.php at line 450 (plugincallbackview::renderimmediate)
    * in main.php at line 104
    * in main.php at line 88

this error come trying to configure some plugin like ffmpeg,netpbm,ImageMagick etc
i searched in lot of pages and i saw that is related to something not well configured in php...
but i'm not able to figure out of this trouble.. any tips???

the gallery in previus version worked well..

Offline mmccarn

  • *
  • 2,651
  • +10/-0
Re: gallery 2.3 problems
« Reply #1 on: November 04, 2008, 08:43:00 PM »
Did you install gallery 2.3 into an ibay, or did you install the Gallery 2.2 contrib then upgrade?

Either way, you need to locate the appropriate httpd.conf template fragment and change the value of
    php_admin_value open_basedir.

This entry should already exist, and include something like /opt/gallery2 - to get ffmpeg etc. to work, you have to add /usr/bin to this.  Separate multiple values with colons, like this:
    php_admin_value open_basedir /opt/gallery2:/tmp/:/usr/bin

You can find all of the template fragments that mention open_basedir using
Code: [Select]
grep -rl open_basedir /etc/e-smith/templates/* /etc/e-smith/templates-custom/*Hopefully, one of them will say something about gallery2, too.

There may be security implications in exposing /usr/bin using open_basedir - I don't know.


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: gallery 2.3 problems
« Reply #2 on: November 04, 2008, 08:43:30 PM »
i get problem upgrading and also installing a new gallery with version 2.3

Code: [Select]
Error (ERROR_BAD_PATH) : "/usr/bin/ffmpeg" is not specified in open_basedir.

    * in modules/ffmpeg/classes/FfmpegToolkitHelper.class at line 191 (gallerycoreapi::error)
    * in modules/ffmpeg/classes/FfmpegToolkitHelper.class at line 52 (ffmpegtoolkithelper::testbinary)
    * in modules/ffmpeg/module.inc at line 211 (ffmpegtoolkithelper::getoperationsandproperties)
    * in modules/core/PluginCallback.inc at line 180 (ffmpegmodule::activate)
    * in modules/core/PluginCallback.inc at line 67 (plugincallbackview::handlecallback)
    * in main.php at line 450 (plugincallbackview::renderimmediate)
    * in main.php at line 104
    * in main.php at line 88

this error come trying to configure some plugin like ffmpeg,netpbm,ImageMagick etc
i searched in lot of pages and i saw that is related to something not well configured in php...
but i'm not able to figure out of this trouble.. any tips???

the gallery in previus version worked well..
I had the same, this means the installer is unable to locate (and execute ) the ffmpeg command. Most likely it is not installed, as is the case with my SME Server, although I have added lots of extras.
Somehow I think the gallery team has not done their exception programming properly. The ffmpeg executable is needed for movies AFAIK, so if you are only hosting pictures this should not be a problem.

If you have installed ffmpeg or any of the other packages and you are still not able to execute them you should have a look at this page: http://wiki.contribs.org/PHP#Open_basedir_restriction
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #3 on: November 04, 2008, 08:47:47 PM »
I had the same, this means the installer is unable to locate (and execute ) the ffmpeg command. Most likely it is not installed, as is the case with my SME Server, although I have added lots of extras.
Somehow I think the gallery team has not done their exception programming properly. The ffmpeg executable is needed for movies AFAIK, so if you are only hosting pictures this should not be a problem.

If you have installed ffmpeg or any of the other packages and you are still not able to execute them you should have a look at this page: http://wiki.contribs.org/PHP#Open_basedir_restriction

ok i can fix like this..
the gallery is in the public dir of the user. and till the last version worked without problem
but i think the team of gallery have to fix the problem..
edit http.conf directly is not good on sme and write always a template is very stiky for non professional user.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: gallery 2.3 problems
« Reply #4 on: November 04, 2008, 08:49:27 PM »
ok i can fix like this..
the gallery is in the public dir of the user. and till the last version worked without problem
but i think the team of gallery have to fix the problem..
edit http.conf directly is not good on sme and write always a template is very stiky for non professional user.
AFAIK you do not need to modify anything as my installation seems to work OK, even without ffmpeg.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #5 on: November 04, 2008, 09:09:59 PM »
I had the same, this means the installer is unable to locate (and execute ) the ffmpeg command. Most likely it is not installed, as is the case with my SME Server, although I have added lots of extras.
Somehow I think the gallery team has not done their exception programming properly. The ffmpeg executable is needed for movies AFAIK, so if you are only hosting pictures this should not be a problem.

If you have installed ffmpeg or any of the other packages and you are still not able to execute them you should have a look at this page: http://wiki.contribs.org/PHP#Open_basedir_restriction
good i saw this command but how i can apply that code to my case??
the gallery is installed in the userspace
to be more precise :

"/home/e-smith/files/users/redteo/home/public_html/gallery"

i'm using php4 for users..
and i need ffmpeg to be able to handle movie on my gallery..
it is used also to made the preview of the files and to put on the reel..

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: gallery 2.3 problems
« Reply #6 on: November 04, 2008, 09:17:00 PM »
good i saw this command but how i can apply that code to my case??
the gallery is installed in the userspace
to be more precise :

"/home/e-smith/files/users/redteo/home/public_html/gallery"

i'm using php4 for users..
and i need ffmpeg to be able to handle movie on my gallery..
it is used also to made the preview of the files and to put on the reel..
Do you already have it installed? If so this should output the path to the file:
Code: [Select]
which ffmpegThat should output something like this if installed:

Code: [Select]
/usr/bin/ffmpeg
If not than you need to install it first (and you most likely did not use it before, so why now all of a sudden?).

Configure the ATrpms repository with the instructions listed here: http://wiki.contribs.org/ATrpms . Be precise, best is copy-paste while using putty as a typo is easily made.

After that do this:
Code: [Select]
expand-template /etc/yum.conf
And then try to install like this:
Code: [Select]
yum install ffmpeg --enablerepo=atrpms
Then try again, it might be you do not need to modify the PHPBaseDir setting at all, if you do so, you have to do some editing to the templates indeed. I do not use the user space, so I can not help you with that at the moment as I do not have knowledge of the templates for this feature (as it is not a default SME Server feature).
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #7 on: November 04, 2008, 09:28:45 PM »
Do you already have it installed? If so this should output the path to the file:
Code: [Select]
which ffmpegThat should output something like this if installed:

Code: [Select]
/usr/bin/ffmpeg
If not than you need to install it first (and you most likely did not use it before, so why now all of a sudden?).
i wrote that with the previus version of gallery worked.. so ;-)

Quote
Configure the ATrpms repository with the instructions listed here: http://wiki.contribs.org/ATrpms . Be precise, best is copy-paste while using putty as a typo is easily made.

After that do this:
Code: [Select]
expand-template /etc/yum.conf
And then try to install like this:
Code: [Select]
yum install ffmpeg --enablerepo=atrpms
this is not working to other pepople reading use dag instead to install ffmpeg.

Quote
Then try again, it might be you do not need to modify the PHPBaseDir setting at all, if you do so, you have to do some editing to the templates indeed. I do not use the user space, so I can not help you with that at the moment as I do not have knowledge of the templates for this feature (as it is not a default SME Server feature).

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #8 on: November 04, 2008, 09:35:23 PM »
the template used to enable the user web space is

Code: [Select]
{
    use esmith::AccountsDB;

    $OUT = "";
    my $accounts = esmith::AccountsDB->open;
    my @users = $accounts->users;

    foreach my $user (@users)
    {
        $OUT .= "\n<Directory /home/e-smith/files/users/".$user->key;
        $OUT .= "/home/public_html>\n";

        $OUT .= " AddType application/x-httpd-php";
        $OUT .= " .php .php3 .phtml\n";
        $OUT .= " AddType application/x-httpd-php-source .phps\n";

        # Set the sandbox within which PHP is confined to play
        my $tmppath = "/home/e-smith/files/users/";
        $tmppath .= $user->key . "/";
        my $basedir = $user->prop('PHPBaseDir') || ($tmppath);
        $OUT .= " php_admin_value open_basedir $basedir\n";
        $OUT .= "</Directory>\n";
    }
}

someone can help me to change the code to insert "/usr/bin"
in open_basedir value to give at php nided to run ffmpeg etc.however i continue to have this doubt, who is rigth? gallery develop team or my config???

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: gallery 2.3 problems
« Reply #9 on: November 04, 2008, 09:40:27 PM »
the template used to enable the user web space is

Code: [Select]
{
    use esmith::AccountsDB;

    $OUT = "";
    my $accounts = esmith::AccountsDB->open;
    my @users = $accounts->users;

    foreach my $user (@users)
    {
        $OUT .= "\n<Directory /home/e-smith/files/users/".$user->key;
        $OUT .= "/home/public_html>\n";

        $OUT .= " AddType application/x-httpd-php";
        $OUT .= " .php .php3 .phtml\n";
        $OUT .= " AddType application/x-httpd-php-source .phps\n";

        # Set the sandbox within which PHP is confined to play
        my $tmppath = "/home/e-smith/files/users/";
        $tmppath .= $user->key . "/";
        my $basedir = $user->prop('PHPBaseDir') || ($tmppath);
        $OUT .= " php_admin_value open_basedir $basedir\n";
        $OUT .= "</Directory>\n";
    }
}

someone can help me to change the code to insert "/usr/bin"
in open_basedir value to give at php nided to run ffmpeg etc.however i continue to have this doubt, who is rigth? gallery develop team or my config???
First retrieve the old value:
Code: [Select]
db accounts getprop user PHPBaseDir
If it does not output anything you need to add do the following (if it does output anything add that to the string below (using the colon ( : ) as a separator):

Code: [Select]
db accounts setprop user PHPHBaseDir /home/e-smith/files/users/redteo/home/public_html/:/usr/bin/
After that expand your webservers configuration file:
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
Test if it is OK:
Code: [Select]
httpd -t
If it says it is OK restart your webserver:
Code: [Select]
sv t httpd-e-smith
After that try and see how things turn out.

Edit: Added trailing slash to /usr/bin/
« Last Edit: November 04, 2008, 09:56:07 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #10 on: November 04, 2008, 10:37:42 PM »
First retrieve the old value:
Code: [Select]
db accounts getprop user PHPBaseDir
If it does not output anything you need to add do the following (if it does output anything add that to the string below (using the colon ( : ) as a separator):

Code: [Select]
db accounts setprop user PHPHBaseDir /home/e-smith/files/users/redteo/home/public_html/:/usr/bin/
After that expand your webservers configuration file:
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
Test if it is OK:
Code: [Select]
httpd -t
If it says it is OK restart your webserver:
Code: [Select]
sv t httpd-e-smith
After that try and see how things turn out.

Edit: Added trailing slash to /usr/bin/
i tried your solution without success i think
that when i do the command to expand the template the in
"/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/94UserWebPhp"
is prevalent.
so the final solution is change the template or edit the httpd.conf

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: gallery 2.3 problems
« Reply #11 on: November 05, 2008, 12:11:25 AM »
i tried your solution without success i think
that when i do the command to expand the template the in
"/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/94UserWebPhp"
is prevalent.
so the final solution is change the template or edit the httpd.conf
That is not what I said, I said:

After that expand your webservers configuration file:
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
As you can see I said webserver's configuration and not configuration template fragment.
What makes you think you should not follow my advice to the letter and start freewheeling? Please execute the commands as stated (apart for inserting the proper username off course).
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline christian

  • *
  • 369
  • +0/-0
    • http://www.szpilfogel.com
Re: gallery 2.3 problems
« Reply #12 on: November 05, 2008, 12:18:40 AM »
This doesn't make sense to me. I came across this on Sunday during my upgrade. Had the same issue where suddenly Gallery 2.3 required /usr/bin in the Basedir path.

I did a similar thing as Cactus outlined. And now all is fine.
However, since I have my gallery in an ibay, instead of expand-template, I used:
Code: [Select]
signal-event ibay-modify
The issue I ended up with was that this was discovered during the upgrade and it did a pretty good job of trashing my set up. I had to go back to a back up and try the upgrade again.

SME since 2003

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #13 on: November 05, 2008, 12:27:39 AM »
This doesn't make sense to me. I came across this on Sunday during my upgrade. Had the same issue where suddenly Gallery 2.3 required /usr/bin in the Basedir path.

I did a similar thing as Cactus outlined. And now all is fine.
However, since I have my gallery in an ibay, instead of expand-template, I used:
Code: [Select]
signal-event ibay-modify
The issue I ended up with was that this was discovered during the upgrade and it did a pretty good job of trashing my set up. I had to go back to a back up and try the upgrade again.
as you said mine is not in ibays
on my server i have two users with installed in the home directory wordpress with gallery
i tryed modify by hand the httpd.conf and it works
but the thing is to change the temlate to give the same modify to all the users in the server...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: gallery 2.3 problems
« Reply #14 on: November 05, 2008, 02:01:12 AM »
as you said mine is not in ibays
on my server i have two users with installed in the home directory wordpress with gallery
i tryed modify by hand the httpd.conf and it works
but the thing is to change the temlate to give the same modify to all the users in the server...
What is your problem? Are you refusing to follow my instructions? Why don't you just follow them to the letter, that should do the trick, without even having to modify templates.

Asking advice and help is a proper thing, not following up advice when given is a stupid thing and frustrating.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline redteo

  • *
  • 122
  • +0/-0
    • redteo blog
Re: gallery 2.3 problems
« Reply #15 on: November 05, 2008, 07:17:32 PM »
sorry cactus, problably my bad english is not able to explain well.
i did letter by letter the istruction you gave.
after i looked on httpd.conf and i saw that eny changed come.
so i think that when i expand the httpd.conf the template change again the code :-(