Archive for November, 2008
Subdomains on localhost in Mac OS X 10.5 Leopard
Posted by admin in Web design & development on November 19, 2008
Apache with PHP and SSI on Mac OS X 10.5 Leopard in two minutes
Posted by admin in Web design & development on November 7, 2008
[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 .shtml2. 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.
Avoid HTML validation errors due to your JavaScript
Posted by admin in Web design & development on November 7, 2008
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.