Category: PHP

PHP optimization, techniques and practises.

Calculate Query Cache

SELECT FORMAT(((QCACHE_HITS / (Qcache_hits + Qcache_inserts + Qcache_not_cached))*100),2) AS query_cache_hit_rate_percentage, QCACHE_FREE_BLOCKS, QCACHE_FREE_MEMORY, QCACHE_HITS, QCACHE_INSERTS, QCACHE_LOWMEM_PRUNES, QCACHE_NOT_CACHED, QCACHE_QUERIES_IN_CACHE, QCACHE_TOTAL_BLOCKS FROM ( SELECT MAX(IF(VARIABLE_NAME = ‘QCACHE_FREE_BLOCKS’, VARIABLE_VALUE, NULL)) QCACHE_FREE_BLOCKS, MAX(IF(`VARIABLE_NAME` = ‘QCACHE_FREE_MEMORY’, VARIABLE_VALUE, NULL)) QCACHE_FREE_MEMORY, MAX(IF(`VARIABLE_NAME` = ‘QCACHE_HITS’, VARIABLE_VALUE, NULL)) QCACHE_HITS, MAX(IF(`VARIABLE_NAME`…

Resolving Public DNS Server List

This information is largely available online; however, I’ve taken the time to compile a list of the common DNS servers here for your own reference. You can use a command such as Dig to query any of these public DNS servers to…

Enable memcache in WAMP

Download memcache for windows (DLL) from https://pecl.php.net/package/memcache Extract the files (php_memcache.dll & php_memcache.pdb) and put in <drive>\wamp\bin\php\phpx.x.xx\ext Update php.ini file with extension=php_memcache.dll (run test page with phpinfo and check “Loaded Configuration File” for php.ini configuration file ) Run following script…

SSL Certificate

What is an SSL certificate? SSL stands for Secure Sockets Layer, a global standard security technology that enables encrypted communication between a web browser and a web server. It is utilized by millions1 of online businesses and individuals to decrease…

Goodbye to DDOS

Hello all Yesterday, my website faced a SYN flood attack, which is a proper pain in the backside and you know how much of a pain it is only after it happens to you. So, the kiddie hackers (hope I…