Category: Uncategorized

            • Nginx + php 5.2.17 + php-fpm

              Download the needed packages and store them in /usr/src:

              http://us.php.net/distributions/php-5.2.17.tar.gz

              http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz

              http://nginx.org/download/nginx-1.1.0.tar.gz

              Then run :

              tar -xvzf php-5.2.17.tar.gz
              gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | sudo patch -d php-5.2.17 -p1
              cd php-5.2.17
              ./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --enable-pdo --with-curl --disable-debug --with-pic --disable-rpath --enable-inline-optimization --with-bz2 --enable-xml --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --with-xsl --enable-zip --with-pcre-regex --with-gd --without-pdo-sqlite --with-pdo-mysql --without-sqlite --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-mysql --enable-bcmath --enable-calendar --enable-exif --enable-ftp --with-gettext --with-imap --with-mysqli --with-openssl --with-kerberos --with-imap-ssl --enable-dbase --with-gmp --enable-shmop --enable-wddx

              make all install

              Note that you can add –prefix to install the binaries in a different location than the default one.

              After compilation is done :

              strip /usr/local/bin/php-cgi
              cp sapi/cgi/fpm/php-fpm /etc/init.d/
              chmod +x /etc/init.d/php-fpm

              cp /usr/src/php-5.2.17/php.ini-recommended /usr/local/lib/php.ini
              mkdir /etc/php/
              ln -s /usr/local/lib/php.ini /etc/php/php.ini
              ln -s /usr/local/etc/php-fpm.conf /etc/php/php-fpm.conf

              Make sure you edit /etc/php/php-fpm.conf and set the proper user/group (and permissions if its the case).

              Then compile Nginx:

              tar zxvf nginx-1.1.0.tar.gz
              ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module
              make && sudo make install

              The same you can modify the –prefix here.

            • Install FFmpeg and FFmpeg-php on Centos 5 and Plesk

              Run :

              rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
              yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2
              cd /usr/src
              Download http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
              tar jxvf ffmpeg-php-0.6.0.tbz2
              cd ffmpeg-php-0.6.0
              phpize
              ./configure
              make
              make install

              Edit /etc/php.ini and add :

              extension=ffmpeg.so

              and then:

              service httpd restart

            • Update php in Plesk

              Run:

              Download http://www.atomicorp.com/installers/atomic.sh
              sh atomic.sh
              yum update php

            • How much disk space a database takes?

              Login to mysql and run :

              select SUM(data_length) + SUM(index_length) as size from information_schema.tables where table_schema = 'your_database';

            • How to redirect my website to be opened through HTTPS?

              In order to redirect your website to be opened through HTTPS, you should add the following rewrite rule in your .htaccess file:

              RewriteEngine On
              RewriteCond %{HTTPS} !=on
              RewriteRule .* https://www.domain.com/%{REQUEST_URI} [R,L]

              This will redirect your domain to https://www.yourdomain.com. If you wish the redirect to work without www, you should remove it from the rewrite rule:

              RewriteEngine On
              RewriteCond %{HTTPS} !=on
              RewriteRule .* https://domain.com/%{REQUEST_URI} [R,L]