标签 PHP 下的文章

In nginx.conf:
. gzip off;
. proxy_buffering off;

或者直接在 PHP 文件头加入

header('X-Accel-Buffering: no');
header('Content-Encoding: none');

你的PHP安装目录可能有所不同,请自行更改

安装 PHP7 Redis
cd /tmp
wget -c https://github.com/phpredis/phpredis/archive/php7.zip
unzip php7.zip
cd phpredis-php7
phpize
./configure --with-php-config=${OPENSHIFT_DATA_DIR}/bin/php-config
make -j4 && make install
sed -i "s/; End:/; End:\n\nextension=redis.so\n/g" ${OPENSHIFT_DATA_DIR}etc/php.ini

安装 PHP7 GeoIP
git clone https://github.com/Zakay/geoip.git
cd geoip
phpize
./configure --with-php-config=${OPENSHIFT_DATA_DIR}/bin/php-config --with-geoip
make -j4 && make install
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
mkdir ${OPENSHIFT_DATA_DIR}geoip
mv GeoIP.dat ${OPENSHIFT_DATA_DIR}geoip/GeoIP.dat
sed -i "s/; End:/; End:\n\nextension=geoip.so\ngeoip.custom_directory=${OPENSHIFT_DATA_DIR}geoip/\n/g" ${OPENSHIFT_DATA_DIR}etc/php.ini