MongoDB, Driver, Rocking

I do admit, yes, am rocking with MongoDB   The simple adapter:   https://github.com/xqpmjh/Trickle/blob/master/include/class.MongoAdapter.php       But also, find a bug : https://bugs.php.net/bug.php?id=60508   To be continue…

Posted in MongoDB, PHP | Tagged , | Leave a 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…   If you’re writing code for yourself, to be used on a server you control, locales could be made to work if your [...]

Posted in PHP | Tagged , | Leave a comment

PHP-FPM for RHEL

1. Patch PHP-FPM to PHP 2. PHP Configure Options for CGI/FastCGI (for help) 3. Install PHP 4. Modify php.ini and php-fpm.conf 5. Test and Start

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 : 2. Modify php.ini : 3. Restart apache (or nginx and php-fpm) and see xhprof section : 4. Start profiling file_to_profile.php : 5. Additional effect with graphviz : to be continue …

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/ 3. Install ionCube Loaders (See http://www.ioncube.com/) : See : ionCube-Encoder-USER-GUIDE

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 eAccelerator : 3. Configurations of eAccelerator : 4. Reload PHP-FPM : 5. See phpinfo to check if eAccelerator is Installed

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 3. Config extension=mysql.so 4. Restart Apache

Posted in PHP, Ubuntu | Tagged , , | Leave a comment

PHP Compile and Install

1. Depend Libs 2. Compile and Install 3. Mysql Socket mysql.default_socket = /var/run/mysqld/mysqld.sock

Posted in PHP, Ubuntu | Tagged , | Leave a comment

Nginx and PHP-FPM for Ubuntu

1. Install and Start Nginx (a) use apt-get (b) compile from source 2. PHP Repository and Install php5-fpm (deprecated from php5.3.3) 3. Config Nginx 4. Start PHP-FPM

Posted in Nginx, PHP, Ubuntu | Tagged , , | Leave a comment

Custom PHP Extension in C

For Linux (Ubuntu Server) 1. Installation 2. PHP Source Package 3. Create Extension PHP_ARG_WITH(example, for example support, [ --with-example Include example support]) 4. Config and Restart Apache extension=ttt.so 5. For PHP-FPM extension=ttt.so 6. Extension Functions PHP_FUNCTION(ttt_hello); PHP_FE(ttt_hello, NULL) PHP_FUNCTION(ttt_hello){ php_printf(“hello !!”); } For Windows 1. Installations and Configurations cygwin (c:\cygwin) vc6 Apache PHP (D:\php-5.2.14-Win32) PHP [...]

Posted in PHP, Ubuntu | Tagged , | Leave a comment