Nightmare of PHP programmer: include_once fails

For a moment it was looking like our project got haunted. Suddenly we started getting errors from the libraries being included twice, function exists and class exits kind of error. First few times it was written off as a “honest” mistake and fixed on spot, but it continued to happen again and again. Of course, it was only showing up on production sites, none of the test sites had this issue. Some digging in the code and pulling hairs out lead to the issue: include_once was failing us. Yes, it was doing include of the same file again! One little detail – that only happened when we used...
read more

Hiring Freelancer vs Employee

When I am looking for web development projects I often see an ads when company is looking for someone they call “Web designer” who is supposed to develop website including graphics, user interface, programming, content and then make sure website will be well placed in Google and have an avalanche of visitors. And salary range is, well, limited So, guess what? It’s just doesn’t make any sense. It’s same as getting a handyman to build the house alone on the empty lot. It will take ages to build and you won’t get the same result as your neighbor who got a builders...
read more

Error 400: Size of a request header field exceeds server limit

If you get error like this one Error 400 Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit. That means that your browser is trying to send too much at once. Probably, it’s size of the cookies. The easy way to fix it – delete cookies. Of course, you lose all info in the cookies, but at least you can access site again. If you develop/manage web site and your customers complain of this error message – there are two things to do: Review cookies and limit the size of cookies your application stores in the browser....
read more

SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘xxx.xxx.xxx.xxx’ (13)

One of the things I wish I had found in Google faster when trying to figure out why PHP script refuses to connect to remote MySQL server issuing an error SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'xxx.xxxx.xxx.xxx' (13) I am able to connect from local shell, so first thought was if something wrong with recent Zend Framework upgrade, but after a while I figured out that answer is very simple – SELinux was blocking remote connections from PHP scripts executed by Apache web server. The error code (13) at the end of error message means “permission denied”, so that’s...
read more

Freelance PHP positions

Do you know PHP and thinking about getting some freelance job? You are not alone for sure, freelancing is a good way to get an extra income, to get started building your portfolio or to stop coming to the office and work from home. Here is a good list of freelance positions for PHP developers: http://workfromhomephpjobs.blogspot.com/
read more