joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

[3.10] on PHP 8.0 Back-end: Call to undefined function Joomla\CMS\Filesystem\set_time_limit() #35196

Closed pe7er closed 3 years ago

pe7er commented 3 years ago

Steps to reproduce the issue

Install a Joomla 3.10 on PHP 8.0.8. After login into the /administrator/ I get the error:

0 Call to undefined function Joomla\CMS\Filesystem\set_time_limit()

And with Debug mode on:

0 Call to undefined function Joomla\CMS\Filesystem\set_time_limit()
/home/ [removed] /libraries/src/Filesystem/Folder.php:612

Call stack
--
# | Function | Location
1 | () | JROOT/libraries/src/Filesystem/Folder.php:612
2 | Joomla\CMS\Filesystem\Folder::_items() | JROOT/libraries/src/Filesystem/Folder.php:532
3 | Joomla\CMS\Filesystem\Folder::files() | JROOT/libraries/fof/integration/joomla/filesystem/filesystem.php:147
4 | FOFIntegrationJoomlaFilesystem->folderFiles() | JROOT/libraries/fof/config/provider.php:190
5 | FOFConfigProvider->getDomains() | JROOT/libraries/fof/config/provider.php:84
6 | FOFConfigProvider->get() | JROOT/libraries/fof/model/model.php:668
7 | FOFModel->__construct() | JROOT/libraries/fof/model/model.php:349
8 | FOFModel::getAnInstance() | JROOT/libraries/fof/model/model.php:439
9 | FOFModel::getTmpInstance() | JROOT/administrator/components/com_cpanel/views/cpanel/view.html.php:52
10 | CpanelViewCpanel->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:664
11 | Joomla\CMS\MVC\Controller\BaseController->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:702
12 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT/administrator/components/com_cpanel/cpanel.php:15
13 | require_once() | JROOT/libraries/src/Component/ComponentHelper.php:402
14 | Joomla\CMS\Component\ComponentHelper::executeComponent() | JROOT/libraries/src/Component/ComponentHelper.php:377
15 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT/libraries/src/Application/AdministratorApplication.php:101
16 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT/libraries/src/Application/AdministratorApplication.php:159
17 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT/libraries/src/Application/CMSApplication.php:225
18 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/administrator/index.php:51

System information (as much as possible)

php: Linux [removed] 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 dbserver: mysql dbversion: 5.5.5-10.4.21-MariaDB-1:10.4.21+maria~focal-log dbcollation: utf8_general_ci dbconnectioncollation: utf8mb4_general_ci phpversion: 8.0.8 server: nginx/1.19.3 sapi_name: fpm-fcgi version: Joomla! 3.10.0 Stable [ Daraja ] 14-August-2021 11:55 GMT platform: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT useragent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

On the site I have Akeeba Backup + JCE Pro + Yoursites + D2 Content Pro. However, after disabling all non-core Plugins the error remains....

brianteeman commented 3 years ago

/home/ [removed] /libraries/src/Filesystem/Folder.php:612

This file was last updated in november

pe7er commented 3 years ago

Ok. I'll test again with a clean Joomla 3.9.10 on another PHP 8 environment.

brianteeman commented 3 years ago

image

PhilETaylor commented 3 years ago

check your web hosts disable_functions value in php.ini configuration....

The @ error suppressor is "probably" masking that and because its a namespaced PHP file, the namespace is being prepended tot he function as a last resort then fatal erroring.

PhilETaylor commented 3 years ago

I have confirmed this tonight. The problem is that your webhost/you have disabled set_time_limit in your PHP Configuration (.user.ini, php.ini) files.

I tested with PHP 8.0.8 and:

disable_functions=set_time_limit
Screenshot 2021-08-18 at 00 07 46

This is not a Joomla bug, only an insane webhost would disable PHP Core functions.

pe7er commented 3 years ago

Thank you both for your answers @brianteeman + @PhilETaylor set_time_limit had indeed been disabled. I've removed it from the disabled functions and the error has been gone.

sunnydrake commented 2 years ago

stumped on same hoster issue with php 8.1 .. in akeeba following code is used to check for function if (function_exists('set_time_limit')) { set_time_limit(0); }


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35196.

PhilETaylor commented 2 years ago

This should be reopened and fixed the same way

sunnydrake commented 2 years ago

also according to code this function is disabled in safe_mode


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35196.

PhilETaylor commented 2 years ago

Its not 1990 any longer - any respectable web host would not be using safe_mode - there are very very little reasons now to run such a configuration.

http://php.adamharvey.name/manual/en/features.safe-mode.php

This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

sunnydrake commented 2 years ago
        if (function_exists('ini_get') && function_exists('set_time_limit'))
        {
            if (!ini_get('safe_mode'))
            {
                @set_time_limit(0);
            }
        }<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/35196">issues.joomla.org/tracker/joomla-cms/35196</a>.</sub>