Some time when you upgrade mysql you may notice this error “start: Job failed to start”, in my case I have big databases on my vps server and causes this problem most often. The problem is that the files ‘/var/lib/mysql/ib_logfile0’ and ‘/var/lib/mysql/ib_logfile1’ are bigger in size than mysql is expecting. The solution is very simple

Installation 1. Installing MySQL 5 sudo apt-get install mysql-server mysql-client 2. Installing Apache2 sudo apt-get install apache2 3. Installing PHP5 sudo apt-get install php5 libapache2-mod-php5 sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl sudo apt-get install php5-xcache 4. Restart Apache sudo /etc/init.d/apache2

Sometimes you need to convert a json string to CSV in PHP. For example we want to get the names Norrmalm and Liljeholmen (cities names at Sweden) from the following json string: ‘{“Norrmalm”:”502″,”Liljeholmen”:”491″}’; Here is the simplest solution: $jsonStr='{“Norrmalm”:”502″,”Liljeholmen”:”491″}’; $csv = str_replace(array(‘[‘,’]’), ”, json_encode(array_keys(json_decode($jsonStr, true)))) echo $csv; It will print out : “Norrmalm”,”Liljeholmen” How it

In order to add a program (e.g opera) to the search launcher at the top left corner of Ubuntu add a file like opera.desktop to: ~/.local/share/applications/opera.desktop Add the following contents to the above file: [Desktop Entry] Type = Application Name = My Opera Comment = Open opera from opera.desktop Exec = /usr/bin/opera Icon = /usr/share/opera/styles/images/Opera_256x256.png

If a resource has moved to another server, you may wish to have URLs continue to work for a time on the old server while people update their bookmarks. Simply add (similar) to the following to your virtual host: <VirtualHost 199.1.1.1:80> ServerName www.siteaddress.com ServerAlias siteaddress.com DocumentRoot /var/www/site RewriteEngine on RewriteRule ^/blog/(.+) http://blog.siteaddress.com/$1 [R,L] </VirtualHost>

When you create PHPUnit tests for your models in Yii using netbeans you may encounter this problem PHP Fatal error: Class ‘CActiveRecord’ not found.. The easiest solution is to include the following at the top of the model class, for example if the class is User then your code should look like $yii=’/opt/lampp/htdocs/yii/framework/yii.php’; require_once($yii); class