Using the Command Line to install or upgrade the Starterkit may require you to take an extra step to change and reset permissions on the sites folder and settings.php file.
DURING DRUPAL INSTALLATION:
sudo chown -R www-data sites
(gives you permission to set the permissions on the sites/default files)
sudo chgrp -R webdev sites
(makes the webdev group have write access)
sudo chmod -R 775 sites
(changes permissions back after install)
For Mac users - Command Line tools can be found here: ss64.com/osx/
The current version of MAMP may require some troubleshooting to get Drush to work correctly. Known issues include:
- Default use of php5.3.6 instead of php5.2.17 causes errors upon update, most commonly "Cannot redeclare class" errors. To solve, change the version of PHP in the MAMP preferences panel or add a line in your .bash_profile to tell Drush to use the right version of PHP
- Inability to connect to localhost MySQL via socket. Causes errors like "Error: PDO::__construct():  No such file or directory (trying
to connect via unix:///var/mysql/mysql.sock)". To solve, from within Terminal run the following commands:
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
To disable and re-enable a project:
drush -y dis PROJECTNAME; drush -y en PROJECTNAME
If you have Devel installed, there is an additional command available;
devel-reinstall which will disable, uninstall, and install a list of projects.
drush -y devel-reinstall PROJECTNAME
Following are some useful Unix/Linux commands which are helpful if you are dealing with large sites (files and db size). I find these really handy when moving sites from one server to other, taking backups of Files, Database etc.
Note: To get access to the Unix command line, you will need an SSH client (e.g. Putty). You can also use WinSCP if you are not comfortable with Command line. WinSCP has a feature to enter custom commands using its interface.
Please add other command-line commands that you use while setting up, developing and managing your Drupal sites.
Zip Contents of current directory
zip -r zipfile.zip *
Unzip Contents into current directory
Unzip (and extract) the tar'd, gzipped archive (tarball) Contents into current directory
tar zxvf tarballfile.tar.gz
Remove a directory and its contents (Use with extra care)
rm -rf directoryname
mysqldump dbname -uUSERNAME -pPASSWORD --host HOST > filename.sql
mysql -u root -p[root_password] [database_name] < dumpfilename.sql
Copy all files / directories from one server to other (Both servers should have SSH Support)
rsync -avz --progress username@servername:sourcefolder destinationfolder
Using the command line can be daunting. This set of videos walks you through the basics of using the command line, from navigating to different file paths to modifying text and moving files around.
- Why the command line can be scary, and the benefits of conquering your fear
- How to navigate file structures and stop processes on the command line
- How to edit and save text files on the command line with VIM
- How to use built-in help on the command line