Fatal error: Uncaught Error: Call to undefined function set_current_screen() in /var/www/html/wp-admin/admin-header.php:30 
Stack trace: 
#0 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php(267): require_once() 
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(219): CRM_Utils_System_Base->theme('<div id="crm-co...', false, false) 
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(233): CRM_Utils_System::theme('<div id="crm-co...') 
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error)) 
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct('DB Error: alrea...', -5, 16, Array, 'CREATE TABLE ci...') 
#5 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-5, 16, Array, 'CREATE TABLE ci...') 
#6 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -5, 16, in /var/www/html/wp-admin/admin-header.php on line 30
  • Can you check CiviCRM logs for detailed error. It seems u getting some db error for creating tables( already exists) . Jan 13 '18 at 15:00

It seems like you have two problems.

As Pradeep mentioned in the comments - it seems like your underlying error is that the install is trying to create a database that already exists. I can't tell for sure, because the error in #4 is cut off.

Additionally, there's the second error (undefined function) which is unfortunately WordPress-specific and I don't know the solution. However, completely removing/creating the CiviCRM database again (assuming that it's separate from WordPress) is likely to solve the first problem, and the second problem won't occur.

  • I had the exact same exact error; creating a new database in the mysql daemon, assigning the same DB user with all privileges and importing the database dump fixed it for me. I still don't know the original cause. Hassan's fix didn't work, though others have said it will. Dec 5 '19 at 22:41

Try adding following line in functions.php file of your child theme.

require_once(ABSPATH . 'wp-admin/includes/screen.php');

Which wordpress version and civicrm version are you trying?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.