Jump to content

FatalErrorException in admin page


barzacchini

Recommended Posts

New Installation on my windows 2008 r2 server

Installation without errors and the shop is perfectly functionaly. When I open admin page (http://localhost/admin/) I have an error:

FatalErrorException in AdminDashboardController.php line 539:
Compile Error: Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

Prestashop 1.7.2.4
php-7.2.0-Win32-VC15-x64
Apache 2.4
mysql-5.7.20.0

can help me?

Thanks

 

Andrea

 

 

 

 

 

Link to comment
Share on other sites

Sorry, other page give me same errors !

Please help me

C:\Apache24\logs\error.log

[Tue Dec 05 09:48:16.033325 2017] [core:notice] [pid 5352:tid 284] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'

[Tue Dec 05 09:48:16.034325 2017] [mpm_winnt:notice] [pid 5352:tid 284] AH00418: Parent: Created child process 6148
[Tue Dec 05 09:48:16.431376 2017] [ssl:warn] [pid 6148:tid 152] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Dec 05 09:48:17.074958 2017] [ssl:warn] [pid 6148:tid 152] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Dec 05 09:48:17.07[spam-filter] 2017] [mpm_winnt:notice] [pid 6148:tid 152] AH00354: Child: Starting 64 worker threads.
[Tue Dec 05 09:48:17.289985 2017] [mpm_winnt:notice] [pid 6164:tid 152] AH00364: Child: All worker threads have exited.
[Tue Dec 05 09:48:23.933329 2017] [php7:error] [pid 6148:tid 1012] [client ::1:51003] PHP Fatal error:  Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false) in C:\\Apache24\\htdocs\\controllers\\admin\\AdminDashboardController.php on line 539
[Tue Dec 05 09:48:26.741185 2017] [php7:error] [pid 6148:tid 1004] [client ::1:51004] PHP Fatal error:  Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false) in C:\\Apache24\\htdocs\\controllers\\admin\\AdminDashboardController.php on line 539
[Tue Dec 05 09:48:29.939591 2017] [php7:error] [pid 6148:tid 1004] [client ::1:51007] PHP Fatal error:  Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false) in C:\\Apache24\\htdocs\\controllers\\admin\\AdminDashboardController.php on line 539
[Tue Dec 05 09:48:46.028134 2017] [php7:notice] [pid 6148:tid 1004] [client ::1:51009] PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in C:\\Apache24\\htdocs\\vendor\\prestashop\\smarty\\sysplugins\\smarty_internal_compilebase.php on line 75, referer: http://localhost/install/index.php
[Tue Dec 05 09:48:49.001512 2017] [php7:notice] [pid 6148:tid 996] [client ::1:51016] PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in C:\\Apache24\\htdocs\\vendor\\prestashop\\smarty\\sysplugins\\smarty_internal_compilebase.php on line 75, referer: http://localhost/install/index.php
[Tue Dec 05 09:54:21.084681 2017] [php7:error] [pid 6148:tid 1012] [client ::1:51032] PHP Fatal error:  Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false) in C:\\Apache24\\htdocs\\controllers\\admin\\AdminDashboardController.php on line 539

Link to comment
Share on other sites

In fact just change add $isNewTheme = false in setMedia declaration and set $isNewTheme in parent::setMedia call.

AdminDashboardController.php  (# 43)

public function setMedia($isNewTheme = false)
    {
        parent::setMedia($isNewTheme);

        $this->addJqueryUI('ui.datepicker');
        $this->addJS(array(
            _PS_JS_DIR_.'vendor/d3.v3.min.js',
            __PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/nv.d3.min.js',
            _PS_JS_DIR_.'/admin/dashboard.js',
        ));
        $this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/css/vendor/nv.d3.css');
    }

I submited this correction on GitHub (https://github.com/PrestaShop/PrestaShop/pull/8588)

Edited by Besens (see edit history)
  • Like 4
  • Thanks 1
Link to comment
Share on other sites

Interesting, we a fixing Prestashop....

I was a bit afraid to make changes to not break it, but since I just test it now ...

So after I applied the fix you said I got 2 more errors:

FatalErrorException in AdminLoginController.php line 400:
Compile Error: Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false)

Then I edited line 164 (in AdminLoginController.php) : public function viewAccess()

to: public function viewAccess($disable = false)

And got the next error:

FatalErrorException in AdminLoginController.php line 400:
Compile Error: Declaration of AdminLoginControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

Then edited line 47: public function setMedia()

to: public function setMedia($isNewTheme = false)

And got acces to BO, at last.

But... I have a warning in BO:

Warning line 569 file C:\\Apache24\\htdocs\\classes\\controller\\AdminController.php
[2] count(): Parameter must be an array or an object that implements Countable

Then a lot of more errors inside BO. Someone from Presta team have to definitely check this tread.

I do have PHP 7.2(64bit) installed, on Apache 2.4.29(64bit)

Windows 7(64bit), VC2017(64bit), MySql 5.6(64bit)

PrestaShop 1.7.2.4

Edited by Mold (see edit history)
  • Like 2
Link to comment
Share on other sites

I've managed to install Prestashop with PHP 7.1

Had to add this to apache's httpd.connf:

  • LoadFile "C:/php71/libeay32.dll"
  • LoadFile "C:/php71/ssleay32.dll"
  • LoadFile "C:/php71/php7ts.dll"
  • LoadFile "C:/php71/libpq.dll"

Because after many tests with different versions of PHP I had no Curl and OpenSSL in phpinfo().

What is interesting the files libeay32.dll and sleay32.dll are missing in PHP7.2. This may have something to do with the problem noted above.

Edited by Mold (see edit history)
Link to comment
Share on other sites

  • 1 month later...

por favor me pueden dar una mano, ayer me salia el error en el admin, pero la paginma cargada bien. Ahora me sale este error

 

[PrestaShopException]

Link to database cannot be established:SQLSTATE[HY000] [1049] Unknown database 'tienda'
at line 102 in file classes/db/DbPDO.php

97.     public function connect()
98.     {
99.         try {
100.             $this->link = $this->_getPDO($this->server, $this->user, $this->password, $this->database, 5);
101.         } catch (PDOException $e) {
102.             throw new PrestaShopException('Link to database cannot be established:'.$e->getMessage());
103.         }
104. 
105.         // UTF-8 support
106.         if ($this->link->exec('SET NAMES \'utf8\'') === false) {
107.             throw new PrestaShopException('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.');
Link to comment
Share on other sites

On 6/12/2017 at 11:17 AM, Mold said:

Interesting, we a fixing Prestashop....

I was a bit afraid to make changes to not break it, but since I just test it now ...

So after I applied the fix you said I got 2 more errors:

FatalErrorException in AdminLoginController.php line 400:
Compile Error: Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false)

Then I edited line 164 (in AdminLoginController.php) : public function viewAccess()

to: public function viewAccess($disable = false)

And got the next error:

FatalErrorException in AdminLoginController.php line 400:
Compile Error: Declaration of AdminLoginControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

Then edited line 47: public function setMedia()

to: public function setMedia($isNewTheme = false)

And got acces to BO, at last.

But... I have a warning in BO:

Warning line 569 file C:\\Apache24\\htdocs\\classes\\controller\\AdminController.php
[2] count(): Parameter must be an array or an object that implements Countable

Then a lot of more errors inside BO. Someone from Presta team have to definitely check this tread.

I do have PHP 7.2(64bit) installed, on Apache 2.4.29(64bit)

Windows 7(64bit), VC2017(64bit), MySql 5.6(64bit)

PrestaShop 1.7.2.4

probe de todo

y esta es la verdadera solucion

mil gracias

THANKS A LOT

 

Link to comment
Share on other sites

On 6/12/2017 at 11:17 AM, Mold said:

Interesting, we a fixing Prestashop....

I was a bit afraid to make changes to not break it, but since I just test it now ...

So after I applied the fix you said I got 2 more errors:

FatalErrorException in AdminLoginController.php line 400:
Compile Error: Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false)

Then I edited line 164 (in AdminLoginController.php) : public function viewAccess()

to: public function viewAccess($disable = false)

And got the next error:

FatalErrorException in AdminLoginController.php line 400:
Compile Error: Declaration of AdminLoginControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

Then edited line 47: public function setMedia()

to: public function setMedia($isNewTheme = false)

And got acces to BO, at last.

But... I have a warning in BO:

Warning line 569 file C:\\Apache24\\htdocs\\classes\\controller\\AdminController.php
[2] count(): Parameter must be an array or an object that implements Countable

Then a lot of more errors inside BO. Someone from Presta team have to definitely check this tread.

I do have PHP 7.2(64bit) installed, on Apache 2.4.29(64bit)

Windows 7(64bit), VC2017(64bit), MySql 5.6(64bit)

PrestaShop 1.7.2.4

hi.. do you  have a solution? maybe some pleople have?

Link to comment
Share on other sites

I solved my same error this way:

- uninstall newest version of xampp, version that gave me these kind of error

- install an older version that worked for me Xampp 5.6.28 (https://sourceforge.net/projects/xampp/files/)

Problem solved. Back office and front office work great.

I needed xampp to restore and older prestashop project. 

 

Edited by magazin online (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Hi all,
FatalErrorException mssgs. resolved with PrestaShop 1.7.3.1 on XAMPP portable win32-7.2.4-0VC15, using PHP 7.2.4

When try to access admin page, for login, system display few, in order, error mssgs:

 

FatalErrorException in AdminDashboardController.php line "43": <- originally find 'setMedia()' on line 43, and add command inside brackets
Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

 

FatalErrorException in AdminLoginController.php line "164": <- originally find 'viewAccess()' on line 164, and add command inside brackets

Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false)

 

FatalErrorException in AdminLoginController.php line "47": <- originally find 'setMedia()' on line 47, and add command inside brackets

Declaration of AdminLoginControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

 

Save both files, and access to admin area over your chosen folder name .../prestashop/admin123/ (NO need for restart server or cleaning browser cache).

Enjoy in your PrestaShop.

P.S. Admins ! Font color picker, on forum, freeze page, need for reload!

Link to comment
Share on other sites

  • 3 months later...
On 6.12.2017 at 3:30 PM, Besens said:

In fact just change add $isNewTheme = false in setMedia declaration and set $isNewTheme in parent::setMedia call.

AdminDashboardController.php  (# 43)


public function setMedia($isNewTheme = false)
    {
        parent::setMedia($isNewTheme);

        $this->addJqueryUI('ui.datepicker');
        $this->addJS(array(
            _PS_JS_DIR_.'vendor/d3.v3.min.js',
            __PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/nv.d3.min.js',
            _PS_JS_DIR_.'/admin/dashboard.js',
        ));
        $this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/css/vendor/nv.d3.css');
    }

I submited this correction on GitHub (https://github.com/PrestaShop/PrestaShop/pull/8588)

 

thanks mate, my problem was not in relation to the topic but your solution helped me very much with this module:

https://github.com/sarjon/gamifications

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi, I have the same error...

FatalErrorException in AdminDashboardController.php line 539:Compile Error: Declaration of AdminDashboardControllerCore::setMedia() must be compatible with AdminControllerCore::setMedia($isNewTheme = false)

I've just uploaded my local prestashop to my hosting. My home page is OK (www.royalfellassb.com) but I can't enter to my back-office since I uploaded my web to the host. I tried what Mold said but It ends with a lot of errors in the back office panels...

Does anybody knows what can I do :( ?

Thanks 

 

Edited by Meli13lm (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hello,

 

prestashop 1.7.3

php 7.2

I had the same issue, I add $isNewTheme = false     in 

controllers/admin/AdminLoginController.php

 

public function setMedia($isNewTheme = false)
 

 

and

 

from:

public function viewAccess()
    {
        return true;
    }

to:

public function viewAccess($disable = false)
    {
        return true;
    }
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...
  • 10 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...