Tag Archives: php

Setting up php-cli for drush on Hostgator

While using Drush on a client’s website I noticed that it was showing up headers when it shouldn’t be. It was showing ugly things like this:

Set-Cookie: SESSc21f969b5f03d33d43e04f8f136e7682=d4735ec22fbf70b7d55bc7bd80691ad4; expires=Sun, 02-Mar-2014 18:44:47 GMT; path=/
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Fri, 07 Feb 2014 15:11:27 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Content-Type: text/html; charset=utf-8

A little investigation showed that drush was running as with php CGI rather than CLI. It was a simple matter to find out the path to the PHP CLI and then to modify the alias to Drush and PHP in the .bashrc file (alternatively, you may have specified it in the .bash_profile or in .profile). So here’s what you SHOULD use:

export COLUMNS
alias drush='/usr/bin/php-cli ~/public_html/drush/drush.php'
alias php='/usr/bin/php-cli'

Form to mail a file – PHP solution

I’ve been looking around for some solutions… I’m working on a website that needs to have a file sent to an email address via a web form. One of the quickest solutions that I’ve found so far is “Design By Elle“, on the page titled “PHP mailer form with file attachment“.

Now, the page loads slowly, so do be patient, but it does load, and the PHP form is quite simple to use.

Other links to pages on which this script is based on:

Now, I’ve not checked out these three links, but maybe you’ll find them useful.