Tag Archives: php

Problems connecting to unix:///var/mysql/mysql.sock

In this post I’ll go through fixing the problems with PHP and connecting to your local mysql install, using “localhost”.

The problems began a while back, with lots of errors in my apache error log saying:
[error] [client ::1] PHP Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in …

Tagged , , , | 3 Comments

Handle different environments with PHP

Being both a Rails and PHP developer, I’m often lacking a few things when I’m switching from Rails to PHP.

One of the things I miss the most, is the different environments that Rails has, which makes testing, developing, staging and production environments easy.
However, I found a way to do this in PHP as well, without using frameworks like Zend, CakePHP etc.

Tagged , , , | Comments Off

Read more, continue reading, and how to easily fix it using WP

Yesterday I updated my grayish blog theme to a new blue and white theme, with more whitespace and less constraints.
While the new theme is isn’t perfect, I shined my website up a bit and it seems nice.

However, scrolling through my twitter list today, I read a blog post by Karan over at mardahl.dk, where she discusses the usage of “Read more” and “Click here” links on webpages. (Direct link to the blog post here).

This made me investigate what my own website was doing, and while the wording was a bit different, I had the same usability problem she describes in the blog post (you should really read it). People tend to overlook the wording, since lots and lots of advertisements use it. So when I use excerpts on my blog front page, and use the wording “Continue reading”, I’m actually scaring the user off, because my message will be misunderstood.

Tagged , , | Comments Off

Switching coffee and PHP testing

Whoa, long time since my last post.

Anyways, what has happened recently?

I’ve switched jobs and are now working at a small IR firm in Denmark, which is located on Amager.
We do webcasts / Quarterly reports for firms in Denmark.

Saying “We do” is a bit off though.
I don’t, that is. I help out if we are missing a technician, else i’m creating webapps to help the business complete daily tasks faster.

Tagged , , , , , | Comments Off

WPML, what is the current language?

While building a wordpress theme that has multilingual support, I needed to know what the current language was for fixing some static parts of my template. After searching a bit on the WPML site, I found a code example where …

Tagged , , , , | 2 Comments

(php) php-mvc-base project released

Whenever I create a new PHP project I use a certain base structure.
This structure allows me to have pretty URLs and have a nice way of configuring the database connections. Furthermore this structure also allows me to use a form of plugins in my system.

Tagged , , | 1 Comment

(php) flash-message plugin

For a long time I’ve wanted a way to send messages from my controller to my view, when posting data. The message could be “Your update went well” or some error.

Tagged , , | Comments Off

(php) Paginate component

After removing CakePHP from my site, I really missed having pagination on it. So I created a small PHP component I’ve called Paginate and I’ve released it over on github: http://github.com/jimmiw/php-paginate.

It’s designed to be easy to use (only 3 lines of code!), and the output should be easy to style.

I hope you enjoy it

Tagged , , , | Comments Off

More features

Alrighty then… I finally got around to add some more features to my webpage, and the first thing I added was the comments section! it’s finally up and running, all you need, is an OpenID and you can login and type a comment to the various posts. I also updated my CakePHP backend to version 1.2rc3, just so i’d have all new thingies.
What else… ah yes… I’ve added a syntax highlighter to the code sections as well. It works rather well, but increases the load time on the page slightly… I’ve also included pagenation on the blog! Was actually kinda fast to implement, just a few lines of Cake code and wupti.

Continue reading “More features” »
Tagged , | Comments Off

CakePHP and the (in)famous Auth component

After struggling for a while with CakePHP (specifically 1.2 rc3, but also in general) and the Auth Component, I finally found out how it works. While working freelance on a site for a customer, I had to make some form of Authentication in order to login the users of the system etc. What better place to start than CakePHP’s own documentation: http://book.cakephp.org/view/172/Authentication

This didn’t really help me on my quest

Tagged , , | Comments Off