PHP Optimization for Millions Visits Level

PHP Optimization for Millions Visits Level from Ho Kim Cheers~ Continue reading
Posted in Architecture, Cache, Optimization, PHP, Training| Tagged , , , , , | 1 Comment

PHP Coding Standard and 50+ Programming Skills

PHP Coding Standard and 50+ Programming Skills from Ho Kim @see http://www.kimbs.cn/category/coding-standards/ @see http://framework.zend.com/wiki/display/ZFDEV/PHP+Coding+Standard+(draft) @see http:/… Continue reading
Posted in Coding Standards, Optimization, PHP, Training| Tagged , , , , | 3 Comments

MongoDB Basics and Tutorial

MongoDB Basics and Tutorial from Ho Kim The bug : https://bugs.php.net/bug.php?id=60508 Cheers~ Continue reading
Posted in MongoDB, PHP, Training| Tagged , , , | 1 Comment

Replace Accents by Normal Unaccented in PHP

Sometimes we need the string to only contain unaccented characters, for example urls, xml, filename etc. Expecially before PHP6, You may think of function setlocale() and iconv(), but they are evil...… Continue reading
Posted in PHP| Tagged , | Leave a comment

PHP-FPM for RHEL

1. Patch PHP-FPM to PHP [codesyntax lang="bash"] $ wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz $ wget http://cn.php.net/distributions/php-5.2.17.tar.bz2 $ tar -jxf php-5.2.17.tar.b… Continue reading
Posted in PHP, RHEL| Tagged , | Leave a comment

XHProf for PHP Profile

Environment : php 5.2.14 xhprof 0.9.2 graphviz 2.26.3 1. Download and install xhprof : [codesyntax lang="bash"] $ wget http://pecl.php.net/get/xhprof-0.9.2.tgz $ tar -xzf xhprof-0.9.2.tgz $ cd xhprof-… Continue reading
Posted in Optimization, PHP| Tagged , , | Leave a comment

Encode PHP by ionCube

1. Environment : PHP 5.2.14 PHP-FPM 0.5.14 2. Encode with ionCube : Download(purchase or try free trial) ionCube encoder from http://www.ioncube.com/ [codesyntax lang="bash"] $ cd /data/soft_misc/ $ t… Continue reading
Posted in Optimization, PHP| Tagged , | Leave a comment

Install eAccelerator for PHP

1. Environment : PHP 5.2.14 : /usr/local/webserver/php PHP-FPM 0.5.14 : /usr/local/webserver/php/etc/php-fpm.conf eAccelerator 0.9.6.1 : /data/soft_misc/eaccelerator-0.9.6.1.tar.bz2 2. Install eAccele… Continue reading
Posted in PHP| Tagged , | Leave a comment

Compile Mysql Extension for PHP

1. PHP Source : /home/kim/php-5.3.3 Path : /usr/local/php 2. Compile Mysql Extension [codesyntax lang="bash" lines="no" container="pre" tab_width="4"] $ cd /home/kim/php-5.3.3/ext/mysql/ $ /usr/local/… Continue reading
Posted in PHP, Ubuntu| Tagged , , | Leave a comment

PHP Compile and Install

1. Depend Libs [codesyntax lang="bash" lines="no" container="pre" tab_width="4"] $ sudo apt-get install gcc $ sudo apt-get install autoconf $ sudo apt-get install libxml2-dev $ sudo apt-get install li… Continue reading
Posted in PHP, Ubuntu| Tagged , | Leave a comment

Nginx and PHP for Windows

1. Environment Window XP Nginx 0.8.50 PHP 5.2.14 2. Download Nginx Unzip to D:\nginx-0.8.50 3. Download PHP Unzip to D:\nginx-0.8.50\php-5.2.14 4. Create D:\nginx-0.8.50\php-5.2.14\php.ini cgi.fix_pat… Continue reading
Posted in Nginx| Tagged , , | 1 Comment

Custom PHP Extension in C

For Linux (Ubuntu Server) 1. Installation [codesyntax lang="bash" lines="no" container="pre" tab_width="4"] $ sudo apt-get install gcc $ sudo apt-get install php5-dev [/codesyntax] 2. PHP Source Packa… Continue reading
Posted in PHP, Ubuntu| Tagged , | Leave a comment

Xdebug for PHP Profile

Windows 1. Download xdebug extension : http://www.xdebug.org/files/php_xdebug-2.1.0-5.2-vc6.dll 2. Add xdebug extension into php : E:\xampp\php\ext\php_xdebug-2.1.0-5.2-vc6.dll 3. Modify php.ini : [co… Continue reading
Posted in PHP| Tagged , | Leave a comment

PHP Coding Standards (5) – Errors and Exceptions

1. The Zend Framework codebase must be E_STRICT compliant. Zend Framework code should not emit PHP warning (E_WARNING, E_USER_WARNING), notice (E_NOTICE, E_USER_NOTICE), or strict (E_STRICT) messages … Continue reading
Posted in Coding Standards| Tagged , | Leave a comment

PHP Coding Standards (4) – Inline Documentation

1. Docblocks start always with "/*" or "/**". The use of "#" is not allowed. The " //" is only allowed for comments within functions. For example : [codesyntax lang="php"] /** * Class docblock */ clas… Continue reading
Posted in Coding Standards| Tagged , | 1 Comment

PHP Coding Standards (3) – Coding Style

1. PHP code must always be delimited by the full-form, standard PHP tags. Short tags are only allowed within view scripts. For example : [codesyntax lang="php"] <?php // Php code here ?> [/codesyntax]… Continue reading
Posted in Coding Standards| Tagged , | Leave a comment

PHP Coding Standards (2) – Naming Conventions

1. The Zend Framework employs a class naming convention whereby the names of the classes directly map to the directories in which they are stored. Based on PEAR Coding Standards , we can easily find t… Continue reading
Posted in Coding Standards| Tagged , | Leave a comment

PHP Coding Standards (1) – File Formatting

1. For PHP files the closing tag (" ?> ") is to be omitted. It is not required by PHP, and omitting it prevents trailing whitespace from being accidentally injected into the output. In fact the proble… Continue reading
Posted in Coding Standards| Tagged , | Leave a comment

PHP Coding Standards – Preview

Zend had provided the guidelines for developers and teams working on or with Zend Framework. Details posted on : http://framework.zend.com/wiki/display/ZFDEV/Zend+Framework+Contributor+Guide . Within … Continue reading
Posted in Coding Standards| Tagged , | Leave a comment