Announcement

#1 2021-01-20 10:31:59

passegua
Member
Italy
2017-04-20
14

Error warnings on new update

Hello/Hi/Greetings,
I decided to update to last version and then now I get:
Warning: popen() has been disabled for security reasons in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 395

Warning: fgets() expects parameter 1 to be resource, null given in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 396

Warning: pclose() expects parameter 1 to be resource, null given in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 398

Warning: A non-numeric value encountered in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 406

So now my Piwigo site is visible, but the admin section is corrupted!

Thanks.


    Piwigo 11.0.0 Controllo aggiornamenti
    Sistema operativo: Linux
    PHP: 7.4.10 (Mostra le informazioni) [2021-01-20 10:24:45]
    MySQL: 5.7.32-35-log [2021-01-20 10:24:45]
    Libreria grafica: ImageMagick 6.9.10-68

Piwigo URL: https://lnx.sinapsi.org/piwigo

Offline

 

#2 2021-01-20 11:39:29

ltecsi
Member
2021-01-20
11

Re: Error warnings on new update

I have the same problem.  The top of Control Panel shows these error messages:
Warning: popen() has been disabled for security reasons in /web/htdocs5/tecsiszantohu/home/www/photos/admin/intro.php on line 395

Warning: fgets() expects parameter 1 to be resource, null given in /web/htdocs5/tecsiszantohu/home/www/photos/admin/intro.php on line 396

Warning: pclose() expects parameter 1 to be resource, null given in /web/htdocs5/tecsiszantohu/home/www/photos/admin/intro.php on line 398

Warning: A non-numeric value encountered in /web/htdocs5/tecsiszantohu/home/www/photos/admin/intro.php on line 406

Offline

 

#3 2021-01-20 14:17:29

erAck
Only trying to help
2015-09-06
1414

Re: Error warnings on new update

Your hoster(s) seem to have disabled some function calls, in this case popen(), "for security reasons". You can check on the command line with

php -r "var_dump(function_exists('popen'));"

which then should return "bool(false)". Ask to have that enabled.

@plg:
it might be worth for a set of functions that enable calls to executables (exec, passthru, shell_exec, system, proc_open, popen) to check whether these are indeed callable.


Running Piwigo at https://erack.net/gallery/

Offline

 

#4 2021-01-20 14:28:58

ltecsi
Member
2021-01-20
11

Re: Error warnings on new update

Thank you very much.  I will contact the webspace provider.

Offline

 

#5 2021-01-20 14:47:10

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13573

Re: Error warnings on new update

erAck wrote:

@plg:
it might be worth for a set of functions that enable calls to executables (exec, passthru, shell_exec, system, proc_open, popen) to check whether these are indeed callable.

I'm searching a pure PHP alternative to calculate the size of a directory, instead of relying on call to external commands (sometimes it's appropriate like ImageMagick, but here, only to calculate the filsize of _data directory, we can do another way). For now, I have:

Code:

function GetDirectorySize($path){
    $bytestotal = 0;
    $path = realpath($path);
    if($path!==false && $path!='' && file_exists($path)){
        foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object){
            $bytestotal += $object->getSize();
        }
    }
    return $bytestotal;
}

Needs to be checked on PHP 5.3 (or I can simply call it only if PHP > 5.6, since I know it works in 5.6)

Offline

 

#6 2021-01-20 15:00:33

erAck
Only trying to help
2015-09-06
1414

Re: Error warnings on new update

Yeah, people still running PHP 5.3 deserve to get less functionality.. :-P
Hell, they're lucky enough if they still own their system (do they? they probably wouldn't even know).


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2021-01-20 15:16:42

passegua
Member
Italy
2017-04-20
14

Re: Error warnings on new update

erAck wrote:

Your hoster(s) seem to have disabled some function calls, in this case popen(), "for security reasons".

I opened a support ticket with my host provider about enabling popen().

Meanwhile I'd like to understand about the other 3 Wanings:

Warning: fgets() expects parameter 1 to be resource, null given in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 396

Warning: pclose() expects parameter 1 to be resource, null given in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 398

Warning: A non-numeric value encountered in /web/htdocs/www.sinapsi.org/home/piwigo/admin/intro.php on line 406

Thanks

Last edited by passegua (2021-01-20 15:17:36)

Offline

 

#8 2021-01-20 16:26:51

ltecsi
Member
2021-01-20
11

Re: Error warnings on new update

My webspace provider said it was not possible to enable those functions unfortunately. 

My environment is PHP v7.4.6

Piwigo 11.0.0 Check for upgrade
Operating system: Linux
PHP: 7.4.6 (Show info) [2021-01-20 16:25:36]
MySQL: 5.7.32-35-log [2021-01-20 16:25:35]
Graphics Library: ImageMagick 6.7.2-7

Offline

 

#9 2021-01-20 17:20:10

passegua
Member
Italy
2017-04-20
14

Re: Error warnings on new update

Also my host provider told me the same:
"I inform you that for security reasons some PHP functions have been disabled. The functions in question are the following:


     system
     popen
     dl
     passthru
     proc_open
     shell_exec

These functions cannot be enabled in Shared Hosting; if your application requires these instructions, I invite you to review your code so that you do not use it"

So? Should I downgrade? Or what?

Thanks.

Offline

 

#10 2021-01-21 10:44:19

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13573

Re: Error warnings on new update

Offline

 

#11 2021-01-21 10:59:50

erAck
Only trying to help
2015-09-06
1414

Re: Error warnings on new update

passegua wrote:

Meanwhile I'd like to understand about the other 3 Wanings:

They are follow-up warnings because popen() failed.


Running Piwigo at https://erack.net/gallery/

Offline

 

#12 2021-01-21 12:01:14

passegua
Member
Italy
2017-04-20
14

Re: Error warnings on new update

plg wrote:

https://github.com/Piwigo/Piwigo/issues/1290

So? What does it mean?

What should we do?

The site seems working properly, is it possible at least hide those disturbing warnings from admin page?

Thankssss

Offline

 

#13 2021-01-21 12:40:34

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13573

Re: Error warnings on new update

Oh, it means an issue has been created in the issue tracker. I fixed it, see [Github] Piwigo commit ab81e770

This fix will be included in Piwigo 11.1.0, coming tomorrow.

Offline

 

#14 2021-01-21 18:34:37

passegua
Member
Italy
2017-04-20
14

Re: Error warnings on new update

plg wrote:

Oh, it means an issue has been created in the issue tracker. I fixed it, see [Github] Piwigo commit ab81e770

This fix will be included in Piwigo 11.1.0, coming tomorrow.

Great! Many many thanks.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact