Jump to content

Warning! class 'ProcessWire\Database' doesn't have a method 'exec'.. and my company's website is broken


Pixrael
 Share

Recommended Posts

Hello everyone, I'm in an emergency. I upgrade mysql on my server and PW does not work anymore, any help is accepted because my company's page is broken now. The thread of this topic can be followed here: https://processwire.com/talk/topic/18917-heeelp-this-request-was-aborted-because-it-appears-to-be-forged/

The problem seems to be this:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'ProcessWire\Database' does not have a method 'exec' in /var/www/vhosts/sitename.com/httpdocs/wire/core/DatabaseMysqli.php on line 38

Thank you in advance!

Link to comment
Share on other sites

Is mysql(i) working with other PHP Scripts?

You can check it with this snippet:

<?php
// just edit the parameters
$con = mysqli_connect("localhost","my_user","my_password","my_db");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>

 

Link to comment
Share on other sites

58 minutes ago, zoeck said:

Is mysql(i) working with other PHP Scripts?

You can check it with this snippet:


<?php
// just edit the parameters
$con = mysqli_connect("localhost","my_user","my_password","my_db");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>

 

Tested.. it's ok because don't echo

Link to comment
Share on other sites

27 minutes ago, kongondo said:

If it's possible to rollback to the original MySQL, I suggest you do that first. Then, on a separate install (even a local one), test as you incrementally upgrade MySQL. 

I don't know if I can rollback, it's a dedicated server in 1and1 and in Plesk I don't see options for that .. I did the upgrade using SSH

Link to comment
Share on other sites

11 minutes ago, adrian said:

One thing I don't get here is why that DatabaseMysqli.php file is being called. I don't think the PW core use mysqli anywhere these days. Do you have a module that is making using of $db vs $database?

PW core uses $db in many places:

wire\core\Database.php line 73 $db = $config->dbName;
wire\core\DatabaseMysqli.php line 37 $db = $this->db($method, 'method');
wire\core\ProcessWire.php line 373 $db = $this->wire('db', new DatabaseMysqli($config), true);

I don't have any modules using this var...

the modules can't load data from fields like textareas, profields, etc

 

  • Like 1
Link to comment
Share on other sites

57 minutes ago, Pixrael said:

I don't know if I can rollback, it's a dedicated server in 1and1 and in Plesk I don't see options for that .. I did the upgrade using SSH

OK. Since your priority is to get you site up and running, is it possible to, are you able to create an alternative database using your older MySQL version? Assuming you have a backup of the site pre-the upgrade, you would then import it into the new database and point ProcessWire to that. That would give you a breather to sort out your main issue.

Just thinking out loud here. You've probably thought of these things already.

Edited by kongondo
  • Like 3
Link to comment
Share on other sites

The website is running now... this morning I reloaded a dump from the database that I saved the day before doing the upgrade to mysql 5.7 and the frontend is working, except the FormBuilder forms and the Backend can't login .. keeps saying: This request was aborted because it appears to be forged.

if I enabled $confg->debug now I get only this:

Notice: Undefined index: type in /var/www/vhosts/sitename.com/httpdocs/site/assets/cache/FileCompiler/site/modules/ProcessGeneralSettings/ProcessGeneralSettings.module on line 65

in this line it have this:

if ($field['type'] == 'Textarea') {

I commented this lines in the ProcessGeneralSettings module and no receive more notices.. this is the Debug Backtrace:

DEBUG MODE BACKTRACE ($config->debug == true):
#0 /var/www/vhosts/sitename.com/httpdocs/wire/modules/Inputfield/InputfieldForm.module(145): ProcessWire\SessionCSRF->validate()
#1 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(383): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData))
#2 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___processInput', Array)
#3 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldForm), 'processInput', Array)
#4 /var/www/vhosts/sitename.com/httpdocs/wire/modules/Process/ProcessLogin/ProcessLogin.module(165): ProcessWire\Wire->__call('processInput', Array)
#5 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(380): ProcessWire\ProcessLogin->___execute()
#6 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___execute', Array)
#7 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessLogin), 'execute', Array)
#8 /var/www/vhosts/sitename.com/httpdocs/wire/core/ProcessController.php(244): ProcessWire\Wire->__call('execute', Array)
#9 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(380): ProcessWire\ProcessController->___execute()
#10 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___execute', Array)
#11 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array)
#12 /var/www/vhosts/sitename.com/httpdocs/wire/core/admin.php(113): ProcessWire\Wire->__call('execute', Array)
#13 /var/www/vhosts/sitename.com/httpdocs/site/modules/AdminThemeUikit/controller.php(15): require('/var/www/vhosts...')
#14 /var/www/vhosts/sitename.com/httpdocs/site/templates/admin.php(15): require('/var/www/vhosts...')
#15 /var/www/vhosts/sitename.com/httpdocs/wire/core/TemplateFile.php(287): require('/var/www/vhosts...')
#16 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render()
#17 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___render', Array)
#18 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
#19 /var/www/vhosts/sitename.com/httpdocs/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array)
#20 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent))
#21 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___renderPage', Array)
#22 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array)
#23 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(808): ProcessWire\Wire->__call('renderPage', Array)
#24 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array)
#25 /var/www/vhosts/sitename.com/httpdocs/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array)
#26 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(383): ProcessWire\ProcessPageView->___execute(true)
#27 /var/www/vhosts/sitename.com/httpdocs/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___execute', Array)
#28 /var/www/vhosts/sitename.com/httpdocs/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array)
#29 /var/www/vhosts/sitename.com/httpdocs/index.php(55): ProcessWire\Wire->__call('execute', Array)
#30 {main}

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...