mysql and mysqldump –defaults-file without a password

MySQL has an amazing option called –defaults-file. It can be used to store credentials in configuration file as it shown in example below: [client] user=dbUser password=dbPassword Make sure you did not store such configration files anywhere inside public_html accessible via HTTP or HTTPS on your website. It is real security breach. Do not do it. … Continue reading mysql and mysqldump –defaults-file without a password

Yii2 Framework console built-in web server can’t start

If you can`t start built-in web server in Yii2 Framework on Windows with error message like Document root “…\console/web” does not exist. in advanced application template you should use the following commands: 1. For backend admin application: yii.bat serve/index –docroot=”backend/web/” 2. For frontend application: yii.bat serve/index –docroot=”frontend/web/” For basic application template use command: yii.bat serve/index … Continue reading Yii2 Framework console built-in web server can’t start

Git: list files between two commits

Git

To display changes between two commits you need to know SHA sum of commit. You can take it from command output. Example command output: Then you can run command: it will show you list of changed files. Alternatively, you can also use command: to see the difference between seventh and fourteenth latest commits.

PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0

To fix error below: You should increase APC opcode cache parameter apc.shm_size, which is set to 32M by default and restart web server Apache module if PHP is set to wokr like web server module. One more thing, you can switch off APC module for some domain or virtual host you can add the following … Continue reading PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0

Example usage of custom fields and shortcode parameters in WordPress CMS

WordPress CMS has a lot of useful features e.g. shortcodes, custom fields. Look at the code example below: In example above it allows to output slides of exact category on page. Possible slider shortcode usage can be: [mySlider slide_category=”1″] Where mySlider is shortcode, slide_category is shortocode attribute which allows us to display flides of particular … Continue reading Example usage of custom fields and shortcode parameters in WordPress CMS

WP-CLI: command line interface for WordPress CMS

If you have shell access to your hosting account and your web server is running WordPress websites under Linux you should check amazing command line utility wp-cli. Some usage examples: 1. Upgrade WordPress CMS core: 2. List installed themes: Example output $ wp theme list +—————-+———-+——–+———+ | name | status | update | version | … Continue reading WP-CLI: command line interface for WordPress CMS