"Function get_magic_quotes_gpc() is deprecated" when installing freepbx on gentoo

Installing framework...
Updating tables admin, ampusers, cronmanager, featurecodes, freepbx_log, freepbx_settings, globals, module_xml, modules, notifications, cron_jobs...
In DBALException.php line 131:
                                                                                                                                                                                                              
  An exception occurred while executing 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Commen  
  t, CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'asterisk' AND TABLE_NAME = 'admin'':                                               
                                                                                                                                                                                                              
  SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql-temptable-a88-10-1.MAI' (Errcode: 13 "Permission denied")                                                                           
                                                                                                                                                                                                              

In Database.class.php line 247:
                                                                                                                                     
  SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql-temptable-a88-10-1.MAI' (Errcode: 13 "Permission denied")  
                                                                                                                                     

moduleadmin [-f|--force] [-d|--debug] [--edge] [--ignorecache] [--stable] [--color] [--skipchown] [-e|--autoenable] [--skipdisabled] [--snapshot SNAPSHOT] [--format FORMAT] [-R|--repo REPO] [-t|--tag TAG] [--skipbreakingcheck] [--sendemail] [--onlystdout] [--] [<args>]...


In Process.php line 239:
                                                                  
  The command "/usr/sbin/fwconsole ma install framework" failed.  
                                                                  
  Exit Code: 1(General error)                                     
                                                                  
  Working directory: /usr/src/freepbx-15/freepbx                  
                                                                  
  Output:                                                         
  ================                                                
                                                                  
                                                                  
  Error Output:                                                   
  ================                                                
                                                                  

install [--dbengine DBENGINE] [--dbname DBNAME] [--dbhost DBHOST] [--dbport DBPORT] [--cdrdbname CDRDBNAME] [--dbuser DBUSER] [--dbpass DBPASS] [--user USER] [--group GROUP] [--dev-links] [--skip-install] [--webroot WEBROOT] [--astetcdir ASTETCDIR] [--astmoddir ASTMODDIR] [--astvarlibdir ASTVARLIBDIR] [--astagidir ASTAGIDIR] [--astspooldir ASTSPOOLDIR] [--astrundir ASTRUNDIR] [--astlogdir ASTLOGDIR] [--ampbin AMPBIN] [--ampsbin AMPSBIN] [--ampcgibin AMPCGIBIN] [--ampplayback AMPPLAYBACK] [-r|--rootdb] [-f|--force]