drupal deployment troubles and problems

Download Drupal Deployment Troubles and Problems

Post on 01-Sep-2014

3.529 views

Category:

Documents

2 download

Embed Size (px)

DESCRIPTION

Drupal Camp Kyiv2010 (http://camp10.drupal.ua/) presentation about Troupbles and Problems during Deployment Drupal projects

TRANSCRIPT

  • Drupal DTP
    Deployment
    Troubles and Problems
    6.x
    @landike (Andrii Lundiak)
  • Deployment steps
  • Steps level
  • What we have today to discuss
    Hosting environment worries
    First install steps
    Magic php.ini
    This very helpful .htaccess file
    We all like settings.php
    Strange unbelievable error messages
    or
    Let find more Troubles and more Problems and Ways how to fix them.
  • Useful MySQL stuff
    • mysqlimport --password=mypass --user=myuserdbname dbname.sql;
    • mysql -h DBSERVER -p -u username dbname < dbname.sql
    • mysqldump-u username -p dbname > dbname.sql
    • mysql -h DBSERVER -p -u username dbname > dbname.sql
    Usemysql.cnffile to run easier
    #---------------
    [client]
    user = myuser
    password = mypass
    host = DBSERVER
    [mysql]
    database = dbname
    #-------------
    mysql< dbname.sql
  • Log Files
    It's good to know what we have on hosting server and especially where Log files are.
    To access the files directly on the server, on some Unix shells, you can type the following command:
    tail -f /var/log/apache2/error.log
    To check that you are looking at the right file, you may wish to type the following commands to find where the log files are.
    grep 'ErrorLog' /etc/apache2/*
    grep 'ErrorLog' /etc/apache2/*/*
  • Error Reporting
    If error reporting is turned off, you could be getting a fatal error but not seeing it. On a production site, it is common to have error reporting turned off.
    Take care to have in index.php:error_reporting(E_ALL);ini_set('display_errors', TRUE);ini_set('display_startup_errors', TRUE);
    this will help in debug/test mode
  • Install and Go
    Create Database and enjoy easy installation
    If some php settings are not in properly state, install process will tell you (about register_globals, mbstring.http_output, safe_mode, etc.)
  • php.ini magician
    How to override php settings:
    value of a configuration option in php.ini
    .htaccess directives
    using ini_set() in settings.php
    or use control panel on your hosting server
    or call to admin person
    or change hosting server
  • Another way to override
    If you have access to php.ini its AWESOME, and Its great if you have your own php.ini near by www
    On some hosting servers such kind of option is used to enable using local php.ini file:
    ssuPHP_ConfigPath /hsphere/local/home/sitelocation
    This setting must be located in .htaccess file
    And php.ini file must exists in /hsphere/local/home/sitelocation/php.ini
  • Allowed memory size
    Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)...
    Increase PHP's memory limit, up to 16MB or 24M or 32MB or especially 96MB for a site with built-in image processing using ImageAPI GD
    memory_limit = 16M in your php.ini file.
    or
    php_valuememory_limit 16Min your .htaccessfile
    or
    ini_set('memory_limit', '16M'); in your settings.php file
    ???
  • Execution time of 30s exceeded
    Fatal error: Maximum execution time of 30 seconds exceeded in .includesdatabase.mysql.inc on line XXX
    The default PHP timeout defined in php.ini is 30 seconds. This is too short for some activities like listing/enabling modules.
    max_execution_time 120; (php.ini)
    php_valuemax_execution_time 120 (.htaccess)
    ini_set(max_execution_time, 120) (settings.php)
    Set max_execution_time = 3000 and Enjoy (is very useful in testing stage)
  • Dear friend - .htaccess
    .htaccess was not uploaded (Access Denied message, Disabled Clean urls)
    • RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    PHP: Error parsing - () was in .htaccess comments
    http://example.com -> http://www.example.com
    • # RewriteCond %{HTTP_HOST} ^example.com$ [NC]
    • # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
    http://www.example.com -> http://example.com
    • # RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    • # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

View more >