How to , and other stuff about linux, photo, php … Another blog just like others on internet

May 29, 2017

How to install git composer globally

Filed under: Linux,Php — Tags: , , — admin @ 10:28 am


The easy way to install composer globally is to run bellow commands

curl -sS | php
sudo mv composer.phar /usr/local/bin/composer

April 25, 2017

how to disable gzip for specific file

Filed under: Linux,Php — Tags: , , , , , , — admin @ 1:33 pm

The short answer is

RewriteRule ^dashboard/index - [E=no-gzip:1]
SetEnvIf REDIRECT_no-gzip 1 no-gzip

Some explination of that solution

The – means NOOP, E means set variable, 1 is the value. After redirects, the variables are renamed and prepended with REDIRECT_.

This work for php FPM

If you have a mod dso you can use also this

apache_setenv('no-gzip', '1');

July 18, 2012

How to install wordpress plugin without ftp user/password

Filed under: Php — Tags: , , , — admin @ 11:30 am

Well I try today to install a plugin on a wordpress. But when I try to install it it request me the ftp user password host, for my hosting account.
Well, i try to chmod 777 the wp-content, still the same, so I force the wordpress to not require ftp by adding some code into wp-config.php

So to fix this chmod 777 wp-content
and add
define('FS_METHOD', 'direct');
to wp-config.php

August 25, 2011

What is the & Ampersand Preceding Variables – reference – php &$

Filed under: Php — admin @ 4:40 pm

You may see PHP code snippets that have an ampersand, ‘&’, preceding a variable like &$examplevar.

So, what does it do? It sets up a reference to the original variable instead of copying it’s value.


$orig = “something 1”;

$reference = &$orig;

echo $reference  // will output “something 1”

Now if we change the $orig with something else

$orig = “something 2”;

echo $reference // will output “something 2”

Powered by WordPress