Problem with upgrading - related to exec()?

scrumpy

Joined: 2004-05-29
Posts: 21
Posted: Sun, 2004-08-01 21:31

Hi,

I've seen a similar post recently regarding exec() and upgrading to G1 v1.44. I've just this evening started to upgarde to 1.44 from a 1.44-rc2, and I now get the "serious error" relating to exec() function when running the configuration wizard.

Has something changed in the code? all was working well in the rc2, and the upgrade wen't like clock work. I'll mail my hosting provider (www.hosting-unlimited.net) but I would hope that they would mail me when there was to be a change as major as this.

Appreciate any assistance.

Thanks,

Stuart

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Sun, 2004-08-01 22:46

exec is the function that Gallery uses to run all of the programs like NetPBM, ImageMagick, jhead, etc. If exec is disabled, Gallery won't be able to process images.

The error was added as an extra warning because many users would try and install Gallery on servers where exec was disabled, and then have to ask us why it didn't work.

 
scrumpy

Joined: 2004-05-29
Posts: 21
Posted: Mon, 2004-08-02 08:29

Hi,

I've been using G1 for many many months now, and I still continue to do so with the 1.44-rc2. This can be seen at www.crump.co.uk/gallery

However, as I said I upgraded to the gold version of 1.44 and it no longer works, well it no longer allows me to complete the config wizard after uploading the new G1 files/code.

Stuart

signe wrote:
exec is the function that Gallery uses to run all of the programs like NetPBM, ImageMagick, jhead, etc. If exec is disabled, Gallery won't be able to process images.

The error was added as an extra warning because many users would try and install Gallery on servers where exec was disabled, and then have to ask us why it didn't work.

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 10:26

Try the last step in FAQ Gallery:c.2 and tell us what it reports.

 
scrumpy

Joined: 2004-05-29
Posts: 21
Posted: Mon, 2004-08-02 10:40

The results from the php statement listed in the FAQ are:

system, shell_exec, popen

So does that mean exec() is disabled? and if so how is gallery installed and working up till now?

Regards,

Stuart

signe wrote:
Try the last step in FAQ Gallery:c.2 and tell us what it reports.

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 11:08

No... it's a false positive that I've just corrected in the code. There's no reason that the fail message on the first screen should prevent you from running setup, however. It's just a message.. it doesn't actually cause setup to perform anything differently.

 
scrumpy

Joined: 2004-05-29
Posts: 21
Posted: Mon, 2004-08-02 11:23

I should be able to run the config wizard. Where can I get the new code? will it be in the CVS library?

Many thanks for being v.responsive.

Stuart

signe wrote:
No... it's a false positive that I've just corrected in the code. There's no reason that the fail message on the first screen should prevent you from running setup, however. It's just a message.. it doesn't actually cause setup to perform anything differently.

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Mon, 2004-08-02 14:50

Hi All, I have also just tried to upgrade to 1.4.4 and get that error abour exec ().

I have asked where I host my site if this can be fixed and there reply was....

"As exec() can be a security risk on a shared hosting setup we disable this for your accounts safty, as such our engineers would not be willing to enable access to that function. Could you please confirm for me what the script is attempting to execute?"

Not knowing anything about the technical side of servers or programming why has this suddenly popped up?

Is this new as previous versions of Gallery have always worked?

Does this now mean I won't be able to upgrade to later versions of Gallery any more...

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 17:23

tomcat76, if you just upgraded from a previously operational Gallery, you should be able to ignore the message. (Unless your host disabled something at the same time you upgraded.)

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Mon, 2004-08-02 18:45
signe wrote:
tomcat76, if you just upgraded from a previously operational Gallery, you should be able to ignore the message. (Unless your host disabled something at the same time you upgraded.)

Hi, thanks for the reply, what I normally do is create a second gallery (gallery2) and make sure it all works ok before updating, so its a new install, the host said this has always been disabled....

Steve

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 19:27

If exec is disabled, Gallery would have never worked, so if you have a working installation, it's probably safe to ignore. It's probably a false positive by the script accidentically catching "shell_exec" for "exec"

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Mon, 2004-08-02 19:46
signe wrote:
If exec is disabled, Gallery would have never worked, so if you have a working installation, it's probably safe to ignore. It's probably a false positive by the script accidentically catching "shell_exec" for "exec"

Phew, that's a relief....
So how do I get around the config and install?

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 19:47

Just ignore the error. The error doesn't cause setup to do anything differently... it just tells you that it probably won't work.

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Mon, 2004-08-02 19:56
signe wrote:
Just ignore the error. The error doesn't cause setup to do anything differently... it just tells you that it probably won't work.

But I cannot proceed with the configuration...
"There are errors in your configuration that will prevent Gallery from functioning properly.
You must fix them before you can continue."

Unless I missed something?

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 19:57

On step 4?

Locate the error in red.. what is it?

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Mon, 2004-08-02 19:59
signe wrote:
Does the button not work?

Button?

I'm on Gallery Config Page 1
The last line is that warning message... no button...

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Mon, 2004-08-02 20:36

Sorry.. yes. You can replace a bit of code.

Find

        if (!empty($disabled) && eregi("exec", $disabled)) {
                $fail["fail-exec"] = 1;
        }
        else {
                $success[] = _("<b>exec()</b> is not disabled on this server.");
        }

in the "check_exec" function of setup/functions.inc

and replace it with

        if (!empty($disabled)) {
                foreach(explode(',', $disabled) as $disabled_func) {
                        if(eregi('^exec$', $disabled_func)) {
                                $fail["fail-exec"] = 1;
                        }
                }
        }
        
        if (empty($fail['fail-exec'])) {
                $success[] = _("<b>exec()</b> is not disabled on this server.");
        }
 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Tue, 2004-08-03 08:00

Many thanks.... fixed.

 
scrumpy

Joined: 2004-05-29
Posts: 21
Posted: Tue, 2004-08-03 13:16

I've changed the code in functions.inc as noted in the discussion but how will that affect any further upgrades? Can I assume that this code change is now incorporated in the 1.x code stream?

Again, thanks for jumping on this one for me and for others.

Please look out for a PayPal donation, your doing a top notch job.

Stuart

 
peh

Joined: 2002-11-24
Posts: 15
Posted: Tue, 2004-08-03 15:27

I changed the lines in functions.inc... but same result... it stops after step 1 and says it cant run any longer.

Isn't there a way to just get rid of this exec() check, so that the configuration can complete??

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Tue, 2004-08-03 15:51
peh wrote:
I changed the lines in functions.inc... but same result... it stops after step 1 and says it cant run any longer.

Isn't there a way to just get rid of this exec() check, so that the configuration can complete??

My fresh install was doing exactly that... and the above code change cured that, it did for me and allowed me to complete the installation.

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2004-08-03 16:20
peh wrote:
I changed the lines in functions.inc... but same result... it stops after step 1 and says it cant run any longer.

Isn't there a way to just get rid of this exec() check, so that the configuration can complete??

If you changed the code and it still fails, then exec really is disabled, and Gallery won't run.

 
scrumpy

Joined: 2004-05-29
Posts: 21
Posted: Tue, 2004-08-03 16:47

I concur with what you are saying...

If you change the code and it works in G1 1.44 then exec() was a false positive, essentially exec() is actually enabled on your hosting companys system and it's just G1 reporting this incorrectly. Now, if you change this in the code and it still doesn't work then your web hosting company has this exec() function disabled for security reasons.

I hope this is clear.

Regards, Stuart

signe wrote:
peh wrote:
I changed the lines in functions.inc... but same result... it stops after step 1 and says it cant run any longer.

Isn't there a way to just get rid of this exec() check, so that the configuration can complete??

If you changed the code and it still fails, then exec really is disabled, and Gallery won't run.

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Tue, 2004-08-03 17:57
scrumpy wrote:
I concur with what you are saying...

If you change the code and it works in G1 1.44 then exec() was a false positive, essentially exec() is actually enabled on your hosting companys system and it's just G1 reporting this incorrectly. Now, if you change this in the code and it still doesn't work then your web hosting company has this exec() function disabled for security reasons.

I hope this is clear.

Not really...

My hosting company say....
"As exec() can be a security risk on a shared hosting setup we disable this for your accounts safty, as such our engineers would not be willing to enable access to that function......"
But Gallery works with the change to the code for me... sorry if I have misunderstood but tis all very confusing...

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2004-08-03 18:15
tomcat76 wrote:
Not really...

My hosting company say....
"As exec() can be a security risk on a shared hosting setup we disable this for your accounts safty, as such our engineers would not be willing to enable access to that function......"
But Gallery works with the change to the code for me... sorry if I have misunderstood but tis all very confusing...

So, it works, or it doesn't work...?

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Tue, 2004-08-03 18:53
signe wrote:
tomcat76 wrote:
Not really...

My hosting company say....
"As exec() can be a security risk on a shared hosting setup we disable this for your accounts safty, as such our engineers would not be willing to enable access to that function......"
But Gallery works with the change to the code for me... sorry if I have misunderstood but tis all very confusing...

So, it works, or it doesn't work...?

Yes, it works.... can complete the configuration and it's up and running though I normally try it for a few weeks to see if it continues to work... before I use this as my main gallery...

Strange thing I just had the option "print this photo with shutterfly" yet all the options were not ticked....

 
peh

Joined: 2002-11-24
Posts: 15
Posted: Tue, 2004-08-03 19:52

Let me try to clarify:

1. My webhost Lunarpages has disabled EXEC.

2. Until the recent version 1.4.4 of Gallery, I did get errors during installation but it did complete.

3. When installation was finished, I changed the fs_unix.php file to use the PASSTHRU command and not EXEC... AND I have been running many versions of Gallery, and right now on two galleries on version 1.4.3pl2... on my Lunarpages host... that has EXEC disabled.!

(I use Gallery Remote for uploading)

So for years I have been running Gallery (slightly modified) on a host with EXEC disabled.

4. NOW, from version 1.4.4 the script not only reports error during installation.... BUT completely stops without any way of getting everything installed... and modifying it as before.

5. SO back to initial question.... how do I get the installation script to run despite the errors..... ???

6. Seems only option is to leave Gallery at 1.4.3 or leave Gallery for good, as it has become almost impossible to use this great script unless you host your own environment.

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2004-08-03 19:59

Well, if you've modified the code enough to know how to do the passthru, you could always just update the check routine. The code is even helpfully pasted in the thread for you.

 
peh

Joined: 2002-11-24
Posts: 15
Posted: Tue, 2004-08-03 21:40

Hello Signe,

Are you referring to your earlier help with modifying functins.inc?....

I did try to modify it, but the install script still stops after the exec check..

So I guess it will take some more to disable it completely.

About the PASSTHRU command, it's actually just one line in fs_unix that is changed.... and after that Gallery has been working very great.

Since Gallery is the best script found, it would really be great with a workaround, since many many hosts now have stopped EXEC... so more and more people have problems running Gallery....

Will G2 have same problem?

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Tue, 2004-08-03 21:48
peh wrote:
Hello Signe,

Are you referring to your earlier help with modifying functins.inc?....

I did try to modify it, but the install script still stops after the exec check..

So I guess it will take some more to disable it completely.

About the PASSTHRU command, it's actually just one line in fs_unix that is changed.... and after that Gallery has been working very great.

Since Gallery is the best script found, it would really be great with a workaround, since many many hosts now have stopped EXEC... so more and more people have problems running Gallery....

Will G2 have same problem?

Yes, G2 will have the very same problem.

What I said was to modify the check so that it looks for passthru instead of exec... it's a one word change.

 
peh

Joined: 2002-11-24
Posts: 15
Posted: Wed, 2004-08-04 15:32

I changed the check for exec() to passthru, and together with the change in fs_unix.php I know run Gallery 1.4.4 on a system with exec() disabled.

So it can be done.... even if there is still a warning when running the config wizard...

But I know have a fully functional Gallery... :lol: so why bother that it is not supposed to work.... :D

 
RSoldin
RSoldin's picture

Joined: 2004-07-22
Posts: 11
Posted: Fri, 2004-08-06 17:25

I have the same problem with the exec() not working. I made sure from the host that it is enabled but when I run the setup it tells me that it isn’t. So, I replaced the code you suggested earlier in this thread, but all I get now is this error

Parse error: parse error, unexpected T_STRING in /home/soldinf/public_html/gallery/setup/functions.inc on line 331

I have tried saving it in many formats with no luck. If this is going to fix my setup problem, can some one email me or post the functions.inc modified file so I can try it?

 
sgf121

Joined: 2004-08-19
Posts: 1
Posted: Thu, 2004-08-19 02:36

peh - What should the syntax be for the new passthru line? I changed exec to passthru to get through the config, but it's giving me an incorrect number of arguments error when I try to upload images.

NEVERMIND!!!! I found it here>
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=19154&highlight=passthru

Thanks!