Recent entries

MySQL Connection Errors After Mac OS X Update

It appears that my local development environment was no longer able to establish a database connnection after a Mac OS X system update. All my Symphony CMS sites stopped working.

I would receive errors like this:

              Symphony Database Error
There was a problem whilst attempting to establish a database connection.
Please check all connection information is correct.
The following error was returned.
2002: No such file or directory

            

I was also unable to connect to my databases through phpMyAdmin.

Since I’m just running this on my localhost, I’m not too concerned about security. So, my phpMyAdmin configuration file looked like this:

              <?php
$i=0;
$i++;
$cfg['blowfish_secret']                = 'helloblowfish';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['user']            = 'root';
$cfg['Servers'][$i]['password']        = '';
$cfg['Servers'][$i]['auth_type']       = 'config';
?>

            

I new that MySQL was running and I was able to access it on the command line without any problem.

              mysql -u root
show databases;

            

So, it had to be a configuration issue. It turns out this was what I was missing for the phpMyAdmin configuration:

              $cfg['Servers'][$i]['socket']          = '/tmp/mysql.sock';

            

None of my local development sites were able to connect to the MySQL server. Gabriel de Kadt was experiencing the same issue: Got an “Error establishing a database connection” in Mac OS X 10.6?. This common error arises from changes to the default location of the MySQL socket.

I used TextWrangler, configured with command line tools, to edit the PHP configuration file by opening a terminal window and typing:

              edit /etc/php.ini

            

I found the line to configure the path for the default MySQL socket

              mysql.default_socket =

            

And changed it to

              mysql.default_socket = /tmp/mysql.sock

            

Then, restart the server

              sudo apachectl graceful

            

Now, I’m back up and running again.

Jeremy Keith: Be Careful What You Wish For

XML and XSLT a Remedy for Vendor-Specific APIs?

The Web Directions panel discussion came around to the topic of APIs and the problem of learning a new one for every web service or having to deal with the problems of integrating those APIs into the particular systems that need to support them. To me this raised the question of why we are using APIs rather than a standard way of sharing data. It seems that XML, XHTML and XSLT would be all that we would need if,

  • The browsers supported the W3C recommendations for the language of the web
  • Developers were using the specs correctly
  • Designers understood the importance of the semantic web and treated content as an opportunity to serve content in fluid and dynamic forms rather than as pixel perfect design templates

If XML is the language of the web, why do we, both designers and developers, keep screwing it up? From what I’ve heard over the course of the weekend, it appears that the stalemate over who would drive the future of the HTML specification, whether the W3C or the WHATWG, was over a question of theoretical purity on one side and practical considerations regarding the way the majority of the web development community was using HTML on the other.

Order Out of Chaos

I’m an ideological purist, I suppose. But I see the concessions as just that: conceding to defeat over the standards that the web standards community have been advocating for. Having discovered XSLT, I have a hard time understanding why the language is not being used, supported, and further developed. It is incredibly powerful and flexible, and for a HTML/CSS designer like myself, it made a lot more sense to take a month to learn XSLT over a year to figure out a scripting language such as Perl, PHP, Ruby, Python, or JavaScript. Not that I don’t have an interest in learning any of these languages, but in the interests of not repeating myself, I would much rather learn something that extends what I already know, which is XML, HTML and CSS.

I recall discovering a reference to XSLT in a discussion by the developers of Drupal about what templating language to support. The decision to go with a proprietary templating system over XSLT was as a result of a desire to attract as many PHP programmers to the project as possible, and the problem with XSLT was that it demands a different approach to programming that would have been unfamiliar to the typical PHP programmer. I’m sure many of us may have been saying the same thing about CSS a decade ago.

Now if the same argument is being made about the direction of the HTML specification, to introduce new elements that emulate many of the classes and IDs that developers are currently using to build sites, that’s all well and good. On the other hand, is it trying to force legacy structures with parallels in a static print design world into the web, where, in semantic hierarchies, the definitions are actually too vague to have any real meaning.

If, as Mark Boulton put it, we are trying to create order where there is chaos, we really must concede that what we do in fact have is chaos. We have several different scripting languages, almost flavours of the day, that we as designers and developers must try to contend with on a daily basis.

The plethora of devices and user agents that are being used to serve all this content, each using their own proprietary methods and interfaces to serve their own needs, often over the needs of the user, further confuse and complicate the problems that we deal with. Do we expect things to be easy? No. Just easier.

What is a Designer?

During the panel discussion about just what does it mean to be a (small “d”) designer or a (big “D”) Designer, I was reminded of something that Dr Tony Golsby-Smith remarked in his talk on the theme of Design Currency, Defining the Value of Design at the Icograda Design Week conference that took place recently in Vancouver, Canada. “Design,” he said, “is a system where humans create what can be other.” In other words, designers are agents of change. We see that something is one thing, but we envision how it could be something else, something better. And then we do something about it. He reiterated, “Our job is transforming: things can be other than they are.”

The way that Tony expounded his point was to start with the art of thinking, pointing to the Greeks and the birth of Democracy as the turning point at which we realized that people’s lives hung in the balance when people were given the power to decide who should rule them and how to decide whether someone should live or die based on the laws of the people. “How do we make decisions, if the people are deciding the fate of people?”

The promise of the information revolution was that we would have more information, more data, on which to base our decisions, thus our decision making would be far more effective. I believe we can safely say that this is not the case. The recent economic downturn may be a case in point.

A Crisis of Control

So, what we have in our modern times is a crisis of control. We want control in the face of chaos, but we don’t have any. Thus we have something called postmodernism. Which is really just a reference to the reaction of modern day managers to modern management theory, in the words of Dr Tony Golsby-Smith, “Oh shit! It’s not working.”

It seems that what we have in development circles is a confusion of languages, a Tower of Babel, where each development culture is approaching very similar problems from a specific linguistic bias. We have become impatient with the self appointed standards body, the one who claims an ojective truth and a set of laws that we should all conform to. So the people would rather go their own individual ways.

If we are all both designers and developers, agents of change, how do we envision a better future? As a front-end designer with a little development knowledge, I would much rather we follow the rules and recommendations that we already have. We’ve learned from experience that when people stray from that we may end up saying, “The internet is dead, and I killed it.” Perhaps XML is too verbose. Perhaps it is not always the best format to work with. But HTML has served us quite well so far. To store information in other ways almost seems redundant.

Maybe the argument is more a practical decision, rather than a purely theoretical concern to ignore XSLT. As with SVG, where lack of browser support has largely rendered it a dead language, perhaps the same is true with XSLT.

While Jeremy Keith may say, “Be careful what you wish for,” I do wish for the ability to have more control over the data as a designer. Design is as much about the structures of the data as it is the presentation. As the power of scripting languages and databases has usurped the static HTML document, the control over data structures become more distant from the designer. My contention is that XSLT is comprehensible by a designer who knows how to select nodes in an HTML document structure, even if the programmers find XSLT obtuse. By using XSLT as a common templating language, more power can be placed into the hands of designers to affect change, while at the same time simplifying the role of the programmer to be able to efficiently model and serve data. Designers can then concern themselves with both the semantic structure and visual presentation of the content without worrying about the limitations of any scripting language, framework or CMS.

Personally, I would much rather the bedrock of XSLT, a W3C standard, than the shifting sand of the plethora of proprietary templating languages.

A London Diary: Day 2

Sunday, June 6, 2010

We chased the sun around the earth for about 10 hours, never losing sight of it, until we arrived in Gatwick at about 11:20 am, Sunday morning. Time is a funny thing. There wasn’t much sleep to be had as the cabin of the plane started out with the air conditioning pouring out cool air so that when someone complained, the system was turned so far down that by the time we landed, everyone was greatful to touch ground and get some fresh air.

After queuing up in the line for the Rest of the World (those without British passports), and being given the stamp of approval that sent me past the security gates, it’s at that moment that I realized I had no idea what my wife’s half-brother looked like. I had never met him before, but had only conversed briefly on Facebook. But he, being a very hospitable Welshman living just an hour south of central London, had offered a place to stay while I was in London. Luckily, he had seen my face on my Facebook profile, among other photos, and on seeing me, lit up with a smile as I walked along, wondering how I was going to recognize him.

Jumping into a campervan, we followed the motorways south toward Kent, to a small town called Gravesend. No one seems to know exactly how it got its name, but there were some vague ideas about the area being the final resting place of Pocahontas or perhaps the burial site for mass graves in the aftermath of the Black Plague.

My plan was to see whether I could adjust as quickly as possible to the local time by staying awake until bed time. After getting acquainted with my half-brother-in-law and his wife, daughter and pet dog, we enjoyed a Sunday dinner of roast beef, Yorkshire pudding, with roasted vegetables and gravy — good British fare. The gifts we found during the Vancouver 2010 Olympics that I brought for their daughter were a big hit, especially the coveted red mittens, her favourite colour.

I thought it might be a good idea to walk around a little to get to know my way around the immediate vicinity and get a taste for the local houses, which mostly consisted of what appeared to be small duplexes that butted up against each other in rows. I discovered later just what a good idea my walkabout had been. This was my first introduction to the experience of being a pedestrian on British roads. My host had said that there wasn’t much to see, but if I took the second left on the roundabouts that I would find the main road to the train station. I instead mistakenly took the third exit that led toward the entrance to a graveyard and mason’s shop just opposite featuring samples of carved headstones.

Fearing I would get completely lost, I made sure I could make my way back before it got dark. Most disconcerting for me was the lack of signs in a standard form to mark the roads. But I was able to make use of little landmarks to find my way back without getting lost. The next day would be the real trial.