debug sql inside cakephp model

$dbo = $this->getDatasource(); $dbo->fullDebug = true; $this->find(‘all’, … $logs = $dbo->_queriesLog; $log = end($logs); print_r($logs);exit;

Configure: error: Cannot find libmysqlclient under /usr/local

The fix is pretty simple, run the following commands and afterwards reenter your previous ./configure command ln -s /usr/lib64/libmysqlclient.so /usr/lib/libmysqlclient.so ln -s /usr/lib64/libmysqlclient.so /usr/local/libmysqlclient.so

install percona in a whm cpanel environment

1. stop all services /etc/init.d/httpd stop ; /etc/init.d/exim stop ; /etc/init.d/pure-ftpd stop ; /etc/init.d/dovecot stop ; /etc/init.d/cpanel stop ; /etc/init.d/lfd stop ; /etc/init.d/munin-node stop ; /etc/init.d/crond stop ; /etc/init.d/mysql stop ; /etc/init.d/exim stop ; /etc/init.d/portsentry stop 2. uninstall mysql, the … Continue reading

install imagick for php

I’ll describe the installation process for Centos as this is my server’s operating system, the installation is very similar for any linux flavour. In order to have imagick class available inside php firstly we need to install ImageMagick-devel: 1. yum … Continue reading

CSS transparent border hack, easy

Recently I wanted to have different elements surrounded by transparent borders. For instance an ajax popup, similar with what facebook has, or a design element to look nicer. The solution is having another div that is inside the one you … Continue reading

install apc for php

cd to where you dearchived the sourcecode files for apc export PHP_PREFIX=”/opt/php” #where /opt/php is where you have php installed $PHP_PREFIX/bin/phpize ./configure –with-php-config=$PHP_PREFIX/bin/php-config make make install add in php.ini the reference to the new extension that was copied inside extension … Continue reading

Linux track cpu usage per user

Quick info how to setup everything so you’ll be able to check the cpu user per each user. As a note I have the PHP set up in fcgid mode and also suexec so each php process is running under … Continue reading

Generate unbreakable passwords from php

This is a short post to share my favorite way of generating strong passwords in php. The advantage over other functions you’ll find over the internet is that it makes sure it uses all the character sets also making sure … Continue reading