Category Archives: web development

PHP on Mac no longer able to connect to MySQL

It’s been a while since I did web development on my Mac, and MySQL ceased to work. Could be related to that one time that I accidentally removed a bunch of dot-files from my home directory, could be related to MySQL upgrade. In any case, it no longer worked.
What I figured out was that the /var/mysql/mysql.sock UNIX domain socket was no longer generated. The /var/mysql folder was missing. When just creating it and assigning it to user _mysql (chown _mysql /var/mysql) did not help, I knew something was wrong with configuration.

MySQL tries to read configuration from /etc/my.cnf. To get its UNIX domain socket where PHP expects it, this needs to be contained in this configuration file:

[client]
port = 3306
socket = /var/mysql/mysql.sock


[mysqld]
port = 3306
basedir = /usr/local/mysql/
socket = /var/mysql/mysql.sock
; datadir = /servers/raiddrive/databases/

Please read the manual for details, and this is not administration advice; I’m not sure if this opens security holes, but I only use MySQL for development purposes. (Because you should know better than letting programmers near mission critical production servers.)

What HTML5 needs to replace Flash?

Much is today said about HTML5. What is HTML5 precisely? HTML5 is Web 3.0. It’s integrated web video, it’s canvas, it’s SVG, it’s CSS3, it’s do-sickening-things-with-CSS3. It’s more Javascript technology and numerous Javascript objects than particularly interesting new HTML tags. (Apart from various special input element types.)

Yet, in this context, let’s consider HTML5’s potential for the so-called “rich content” — that is, let’s just consider how we could create animations and toons similar to what can be done with Macromedia Adobe Flash.

Flash is currently ubiquitous. Not because people love having another plugin in their browser; those aware of a concept of plugin don’t like having yet another plugin. Especially not the one that slows page loading; let’s remember Java applets. User doesn’t like browsers that crash; Flash Player can cause that to happen. User doesn’t like slow speeds that Flash Player delivers.

So who actually likes Flash? Content producers. Flash is an extremely likeable tool once you get to know it, and animation production is very rapid. It’s the RAD tool of web animation. Combine a true artist, skill in a pixel-based art tool (GIMP, Photoshop, PhotoPaint) and Flash, and you get one of those truly artistic movie web sites. Personally I hate the experience of those sites, but I admire the artists and designers who created the experience*. It’s a lot of work, and a lot of talent, all possible because you don’t have to have a geek programmer in the team, all possible because you don’t have one who’d say “Yeah, sorry, I can’t do that in Javascript that easily.”

That’s the key thing. You don’t need a geek to implement the animation. With Javascript animation, one could see a lot of cool stuff, “proving” that HTML5 is as good for animation as Flash. In fact, one can already find Smokescreen, a really awesome piece of engineering work that implements a Flash player with Javascript.

However, apart from Smokescreen, which again plays with Flash, every single Flash-like animation was tediously coded by a geek programmer. JQuery may make stuff simpler, but it’s not designer-material!

HTML5 animation needs proper authoring tools.
There is a market for HTML5 animation authoring tools.
Layers, tweens, reusable “symbols”, grouped “symbols”, vector elements, bitmap elements, at least basic early-Flash-style event handlers .. Give designers that, and they may jump on the Flash-less train.

In fact, even a geek like me will prefer using Flash, because doing HTML5 animation is tedious. Flash, despite being ruined compared to its early days, reigns as a creation tool.

I’m even willing to privately pay for an HTML5 animation tool. Not too much, but I’m willing.  Someone out there to snatch my cash? (Apart from Adobe, I don’t like them as a company.)

* I admire Flash artists — except those that create ads, I hate Flash ads passionately

Image courtesy of GretemanGroup.com/blog and FlashInYourFace.com

Yahoo! OpenID’s XRDS check, Apache2 and PHP

Another continuation of a previous blogging session 🙂

A reminder, we’re talking about this:

Warning: This website has not confirmed its identity with Yahoo! and might be fraudulent. Do not share any personal information with this website unless you are certain it is legitimate.

PHP+Apache2 users out there might be interested in this reminder, which it’s already mentioned on previous post’s checklist, but I’d like to point it out again.

Don’t name your file xrds.xml.php and try to serve it as xrds.xml while changing Content-type to application/xrds+xml in the header. Apache2 is braindead (or used to be) and doesn’t even attempt to execute the file.

Yahoo! sends an Accept header in its HTTP request, listing application/xrds+xml. Apache decides your file is not of correct filetype, and sends Yahoo! the 406 Not Acceptable response. Referring to same file with the .php extension included makes Apache actually execute the file, and then compare the content-type to the accept header from the client.

SUSE Studio rocks


I’ve taken it for a spin. It’s a heavily-AJAXed system that allows you to create your own mini-distro of Linux, a.k.a. “appliance”, based upon SUSE. You can build it into bootable ISO or into bootable HDD or USB flash drive image. You basically customize it, add SUSE packages into it, add additional custom files, and press build.

Best part of it is however test drive – once you build the system, you can take it for a spin in a flash-based remote desktop client, pictured above. If you are happy with it, download the image and that’s it!
PS Yes, I’m running XP at the moment, and no, I’m not proud of it 🙂

Adobe Flash on iMac with Mac OS X 10.3.9

CLICK HERE FOR SOLUTION TO THE PROBLEM

It’s fascinating that Flash Player as recent as version 9 is available, since a large part of the web (including Blogger) is plain broken in Safari 1.3 (included with OSX 10.3.9).

What’s horrifying however is Adobe’s treatment of potential users of this player. Can you imagine correctly detecting MacOS X, and offering software download for 10.1-10.3… and actually breaking the dropdown menu, as well as the continue button?

That’s right. Dropdown menu on the main download page – click on it in either Safari 1.3 or MSIE:mac 5.2, nothing happens. Ok, no sweat, let’s try alternative download path. So, I’m asked for OS… I choose Mac OS X 10.1-10.3. Cool… “Continue”. Nothing. “Continue”! Nothing.

They actually broke Javascript on an OS the download is meant to go for. And from what I can tell, you’re not allowed to redistribute Flash player without arranging licensing agreement with Adobe, so I doubt I can find it elsewhere on the web.

Is it really too much to expect primary download route (the combo for selecting 10.1-10.3 or 10.4-10.5) to work?
Is it really too much to expect the alternative, “safe” route to work? People, it’s a Continue button, how can you screw that up on an outdated, but still supported and actually even listed platform?

Yahoo! Search uses Google Gears for local storage?

Update, August 9th 2009: It’s used only on Google Chrome, and it’s used by the Search Pad for improving the user experience by speeding up responsiveness. I’ve recently written a new post on the subject.

I’ve just used Yahoo! Search in Google Chrome. I got a typical Gears popup asking me if I want to let the web site use Gears. I still have no idea why Yahoo! suddenly likes using a Google product; neither Google Search nor Yahoo! Search are helpful for several keywords.

Yahoo!’s Search blog doesn’t mention it either.
Any info, anyone?