Blogs

Drupal 7 print stack trace

Drupal 7 stack trace

 

//$e = new \Exception;
//$trace = var_dump($e->getTraceAsString());
//$trace = $e->getTraceAsString();
//$formatted_trace = str_replace('#', '<br />#',$trace);
//drupal_set_message($formatted_trace);
//drupal_debug($e->getTrace());
//debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
 

Repair mysql database

After an unexpected shutdown, your mysql dastabase files might need to be recovered.

https://www.a2hosting.com/kb/developer-corner/mysql/repairing-mysql-data…

Database datafiles for mysql are typically in /var/lib/mysql, one folder for each schema so long as you have innodb_file_per_table set.

[mysqld]
innodb_file_per_table=1

The mysql log file can be found at /var/log/mysql/error.log. 

Check each database with

mysqlcheck my_database

Install Drush 8

You will need drush 8 and drush 7 to work with Drupal 8 and with Drupal 7.

This requires composer already installed.

Install

mkdir ~/drush8
cd ~/drush8
composer require drush/drush:8.x

You may have drush 7 already installed. If not, then

mkdir ~/drush7
cd ~/drush7
composer require drush/drush:7.x

 

Update aliases

In .bash_aliases add

#alias drush7='~/drush7/vendor/bin/drush'
alias drush8='~/drush8/vendor/bin/drush'

Uncomment the drush7 alias if you need it.

and source your .bash_rc file

Pages

Subscribe to Blogs