Archive for November, 2008

Subdomains on localhost in Mac OS X 10.5 Leopard

/code.google.com/p/virtualhost-sh/

code.google.com/p/virtualhost-sh/wiki/VirtualhostsOverNetwork

patrickgibson.com/utilities/virtualhost/

how-to-setup-development-domains-on-os-x/

, , ,

No Comments

Apache with PHP and SSI on Mac OS X 10.5 Leopard in two minutes

[Update - see here. I wouldn't recommend the Apple PHP distro anymore as it has shortcomings. Roll your MAMP!]
See full description for PHP here, for activating SSI here.

Add PHP with debugging

Activate: goto /private/etc/apache2/httpd.conf and uncomment LoadModule php5_module . Save.
Add debugging: In Terminal type:
cd /private/etc
sudo cp php.ini.default php.ini

Edit said php.ini: change
error_reporting = E_ALL & ~E_NOTICE to
error_reporting = E_ALL .Save

Add SSI

Go back to /private/etc/apache2/httpd.conf

1. Uncomment these lines from the <ifmodule mime_module> stanza:
AddType text/html .shtml and
AddOutputFilter INCLUDES .shtml

2. Add “Includes” to the “Options” statement in the <directory "/Library/WebServer/Documents"> stanza (so it now reads
Options Indexes FollowSymLinks MultiViews Includes)

3. [Re]start Apache with sudo apachectl graceful

Job’s a good ‘un.

, , , , ,

No Comments

Avoid HTML validation errors due to your JavaScript

One of the reasons I changed a random content rotation script that was sitting in my <head> tags last month was because this JavaScript failed to validate. I don’t intend to change back – but today I found out the why-for when I came across the same thing happening in two versions of “The Son of Suckerfish”. One wrapped the JavaScript with CDATA tags the other not. That simple. Of course removing the script into its own file would do the trick too.

Don’t forget to wrap up your script tags safely!

<script type="text/javascript"><!--//--><![CDATA[//><!--
PUT YOUR CODE IN HERE
//--><!]]></script>

This applies to all XHTML pages.

, , ,

No Comments