Create a Virtual Host on Windows

While you can often stick a project in a subdirectory of your htdocs and access from localhost/project, that can be inconvenient (e.g., assume leading slashes from absolute-from-root pathing, like /path/to/file.ext). It’s simple enough to create a virtual host like http://project.local or 1. Open httpd-vhosts.conf (usually in your Apache install directory, under conf/extra… note that […]

Komodo IDE – format PHP

This wasn’t as simple as it should have been. On windows, there are some gotchas. 1. Install PEAR if you haven’t already. In your PHP installation directory, there’s a batch file named “go-pear.bat”. Double click that. Let it add PEAR to your PATH (just say “yes” to everything). 2. Install PHP Beautifier. You don’t need […]

CodeIgniter on Windows – remove index.php with .htaccess rewrite

The CI user guide suggests this as a .htaccess to redirect all incoming traffic to index.php (except for direct requests, images, and robots): [text] RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] [/text] …which barfs on windows installs (I happen to be Windows, Apache, MySQL and PHP, but not using a WAMP package). Removing […]

PHP on Windows and VC versions

For no apparent reason, PHP crapped out on me the other day (wouldn’t load ANY modules – the most obvious error was ‘undefined function mysql_connect’). I had PHP 5.3.5 VC6, as tells us to use this build when using PHP as an Apache module. So I go to re-install (the plan was just to […]

Error on large MySQL imports on a WAMP stack…

Error: [text]Got a packet bigger than ‘max_allowed_packet’ bytes[/text] Fix: 1. Open my.ini from your MySQL installation directory, add this line to the [mysqld] section: [text]max_allowed_packet = 100M[/text] (The value (100M) is arbitrary – use whatever.) 2. Restart MySQL (easiest way IMO is Start > Control Panel > Administrative Tools > Services… right-click ‘mysql’ service and […]

Using Virtual Hosts (vhosts) on Windows (WAMP)

A very handy feature Apache offers is the ability to easily create Virtual Hosts – psuedo-domains that function like the real deal. I have to admit, I spent a couple years in the world of localhost before figuring out what could be done with vhosts, and remember the pain of always having to append a […]