Monday, April 15, 2013

Relaod/refresh page with Javascript Jquery

$('#something').click(function() {
location.reload();
});
the reload() function takes an optional parameter that can be set to true to reload from the server rather than the cache. The parameter defaults to false, so by default the page reloads from the browser's cache.

Saturday, April 6, 2013

Installing Ioncube

1. Download ioncube:

wget http://downloads.ioncube.com/loader_down...x86.tar.gz

2. Extract ioncube
tar zxvf ioncube_loaders_lin_x86.tar.gz


3.move file ioncube_loader_lin_5.3.so
mv ioncube/ioncube_loader_lin_5.3.so /usr/lib/php5/20090626/


4.create file called ioncube.ini (I use nano, you pick your editor)
nano /etc/php5/conf.d/ioncube.ini

5.copy and paste this line
zend_extension = /usr/lib/php5/20090626/ioncube_loader_lin_5.3.so

6. Restart Apache
/etc/init.d/apache2 restart


7. check if installed correctly
php –v

You should have working ioncube installation now. If not check what you missed.

Switching to worker mpm from prefork apache 2 on ubuntu


I'm on ubuntu and according to some tutorials, the following lines would do all the tricks:
apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php5-gd
a2enmod actions fastcgi alias
Then you setup configuration in /etc/apache2/conf.d/php5-fpm.conf:
<IfModule mod_fastcgi.c>
                AddHandler php5-fcgi .php
                Action php5-fcgi /php5-fcgi
                Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
                FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization</IfModule>
After all these, restart:
service apache2 restart && service php5-fpm restart
 
Done! 

PHP files downloading instead of executing

When you open your site php files are downloading instead of executing follow these simple steps and you will be good to go again.

first, install libapache2-mod-php5

sudo apt-get install libapache2-mod-php5

Then enable it

sudo a2enmod php5

Restart apache

sudo service apache2 restart

Clear your cache on your browser, and re-load the page.

Your php files should start executing again and you will see your site.