Sunday, September 22, 2013

How to Enabling the openSSL PHP extension in XAMPP

I assumed you're installing your copy of XAMPP in c:\xampp

First, do make sure you have the library file named 'php_openssl.dll' in your c:\xampp\php\ext directory or just paste this script below into command line and run it :

if exist c:\xampp\php\ext\php_openssl.dll (echo YES) else (echo NO)

Next, go open the 'c:\xampp\php\php.ini' file and remove the semicolon to:


If you don't have that line, just write that line down (without semicolon of course), in the "Dynamic Extensions" section. Don't forget to save it.

 Last, restart the Apache service through XAMPP panel, and you're done :-)

Wednesday, September 18, 2013

How to clear memory cache & swap space on your Linux system

If you think your Linux system has decreased performance,you can try  some workarounds such  clear the memory cache and clear the swap space.

To clear the filesystem's memory cache, run the following commands:

[root@development ~]# sync
[root@development ~]# echo 3 > /proc/sys/vm/drop_caches
[root@development ~]# echo 0 > /proc/sys/vm/drop_caches
[root@development ~]# sync

To clear the swap space, run the following command:

[root@development ~]# swapoff -a && swapon -a

For daily automation, paste the above two commands in your cron jobs, such as the following:

0 1 * * * /sbin/swapoff -a && /sbin/swapon -a
0 0 * * * /bin/sync; echo 3 > /proc/sys/vm/drop_caches; echo 0 > /proc/sys/vm/drop_caches; /bin/sync

Note : i use CentOS 6.4 with root privilege

Hope these tricks helps