A friend recently had a problem configuring a new server. He installed PHP, Apache, MySQL and phpMyAdmin but when he launched it he got the following error:
phpMyAdmin – Error
Cannot load mysql extension. Please check your PHP configuration.
If you’ve installed all of the above more than once you’ll know what is more than likely wrong. The MySQL PHP module isn’t loaded. First of all, you must find your php.ini. It could be anywhere but if you create a small php file with the
phpinfo(); command it will tell you where it is. Common places include /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini
Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!
Calling all MySQL admins! When you’re working with InnoDB tables you may have noticed that MySQL takes an extraordinary amount of time to shutdown. Don’t panic! It’s normal.
InnoDB has extensive logs that it must run through and if your server is at all busy these logs can be quite big.
After you’ve started the equivalent of “
/etc/init.d/mysql stop” it may not return for quite a while. Simply open another terminal and examine the system log. On a Debian or Ubuntu box, look at /var/log/daemon.log and you’ll see the “InnoDB: Starting shutdown…” message.
Now, go off and make a cup of tea because this could take a while. On a fairly large and busy database it might be half an hour or more!
Please, please, please don’t be tempted to
killall -9 mysqld because bad things will happen! Even if your boss is looking over your shoulder, and you’ve promised that the company webserver will be online in 2 minutes, don’t do it.
However, cases where it is ok to kill the database with a “kill -9”:
- International terrorists are planning on robbing the World Bank and you’re the only secret agent who can bring down the database which will stop them.
- Lassie will be run over by the evil farmer who plagued the local village with his monster cows unless you can corrupt his database in time.
- Or finally, you like hard work and restoring from backups!
Andrew van der Stock’s criticism of PHP’s security model. What security? Global request arrays go some way to making applications safer but there are obscure functions and settings which can trip up developers. (via)
PHP Optimization Tricks from Ilia Alshanetsky has one gem I didn’t know about – the ctype extension. It’s somewhat limited but would be faster and less resouce intensive than a regular expression to do simple checks.
Yes, newer browsers have SVG support but this will work in older browsers and newer. Cute.
2 links for the developers around here:
- Regular Expression Checker – regexes are an arcane science. Everyone needs all the help they can get when working with them! (via)
Later.. Here’s another AJAX powered regular expression checker via Matt.
Ever wondered how some of your favourite apps get hacked and broken into? This page lists lots of examples of database “injections”.
Like an injection you get off your doctor these bits of code inject database code into your application. The code can do anything – delete all your data, grab your passwords, or anything.
And if it happens to you, a nice doctor isn’t going to give you a lollipop.
He has a couple of examples on his page, and it looks easy enough in principle. The devil’s in the details don’t you know but it looks like it’s worth trying!
He’s a busy beaver too.. he has an MVC framework and tutorial that steps you through an example.
How to Use Design Patterns
Among developers, design patterns are a popular way to think about design, but what is the proper way to think about design patterns? In this interview, Erich Gamma, co-author of the landmark book, Design Patterns, talks with Bill Venners about the right way to think about and use design patterns.
Making Wrong Code Look Wrong – I was away for 2 weeks, catching up on email only now!
Usability testing can be daunting and goes overlooked in the rush to get things out the door, but it’s important, if somewhat hard on the egos of developers when their super-duper ideas are torn down and trodden on!
See the great comic too! hehe.