Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Aug 102010
 

Change the maximum allowed binary log file size in MySQL

Answer:

By default, the MySQL's maximum binary log file is 1073741824 bytes (1GB).

If you want to change it, edit the MySQL configurations, e.g. /etc/my.cnf

[mysqld]
...
...
max_binlog_size 4294967296

Restart MySQL to take effect.

# /sbin/service mysqld restart

Now the new maximum binary log file is set to 4GB.

Aug 092010
 

Mirror a web site using wget

Answer:

wget is a standard program came with most Linux distributions. It allows you to create a mirror (backup) of a web site easily using the following command.

# wget -m -k -K -E http://www.example.com

Aug 092010
 

Update the Channel List using PHP/PEAR

Answer:

PEAR is a framework and distribution system for reusable PHP components. To update the channel list, what you need to do is type the following command.

# sudo pear channel-update pear.php.net

Aug 082010
 

Syntax highlighting in PHP

Anwser:

PHP has a built-in function that help to to syntax highlight your PHP codes.

E.g.

<?php

$str = <<<EOT

    echo "This is a test";


EOT;

highlight_string($str);
Aug 072010
 

Solving the warning message "Xdebug MUST be loaded as a Zend extension"

Answer:

If you have installed the xdebug, and the PHP interpreter show the following warning message every time you execute the php command.

Xdebug MUST be loaded as a Zend extension

It can be solved by adding the following line in your php.ini (Replace the path of you xdebug.so if they are different.)

zend_extension="/usr/local/php/modules/xdebug.so"

And remember to remove any statement like the following which caused the problem..

extension="xdebug.so"