Install SSH2 Extension for PHP 7 on CentOS 7

Install gcc, php71w-devel, libssh2 and libssh2-devel on CentOS 7 # yum install gcc php71w-devel libssh2 libssh2-devel Download php7 pecl-networking-ssh2 # wget https://github.com/Sean-Der/pecl-networking-ssh2/archive/php7.zip Unzip and Change folder # unzip php7.zip # cd pecl-networking-ssh2-php7 Building environment for SSH2 extension # phpize # ./configure Make SSH2 extension make sure build success # make Install SSH2 extension # make … Read more

PHP in Amazon Lambda

Clone or Download this GitHub Repo https://github.com/svnlabs/aws-lambda-php-template Make new folder lambda in current working directory of EC2 server # mkdir lambda Upload 2 files from zip to Amazon EC2 server Instance in folder lambda lambda – index.js – php (binary) index.js ‘use strict’; exports.handler = function(event, context, callback) { var exec = require(‘child_process’).exec; exec(‘./php -v’, … Read more

Installing Apache, MySQL, PHP in Gentoo Server

All commands are performed as root to install Apache, MySQL, PHP and phpMyAdmin in Gentoo Linux Server. 1. Update your System # emerge –sync 2. Install Apache Webserver # emerge apache The web server ROOT is in /var/www/localhost/htdocs/ # /etc/init.d/apache2 start Then go to http://server-ip/ Add apache2 to the startup script # rc-update -v add … Read more

Creating Zip Without Recording ROOT Paths

Simply use chdir() to change the working directory before you exec() Or you can use …. exec(“cd /var/www/html/media; zip -r -9 Media.zip . 2>&1”, $log); exec(“mv /var/www/html/media/Media.zip /var/www/html/Media.zip”); Get zip file size exec(“ls -ls /var/www/html/Media.zip | awk ‘{print $6}’ 2>&1”, $size); $zipsize = implode(” “, $size); Without this solution Length Date Time Name ——– —- … Read more

Install Airtime – open source radio automation software

Airtime is open source radio automation software (GPL v3) for GNU/Linux platforms. It’s recommend installing on Ubuntu Linux 12.04 LTS or Debian Squeeze on a computer with at least a 1 GHz processor and 512 MB of RAM for a Server Edition OS or 1GB of RAM for a Desktop Edition OS. Download airtime-easy-setup $ … Read more

Amazon S3 Expiring Link

I was working on Amazon S3 Cloud HTML5 MP3 Player for S3 Bucket security and Expiring Media links. <?php   if(!function_exists(‘el_crypto_hmacSHA1’)){       /**       * Calculate the HMAC SHA1 hash of a string.       *       * @param string $key The key to hash against       * @param string $data The data to hash       * @param int $blocksize Optional blocksize       * … Read more

PHP Run Background Process using Exec

If you need to start process in background and get its PID to manage it later using PHP. <?php function runInBackground($command,$log,$priority=0) { if($priority)    $PID=shell_exec(“nohup nice -n $priority $command > $log 2>&1 & echo $!”); else    $PID=shell_exec(“nohup $command > $log 2>&1 & echo $!”); return($PID); } ?> echo $! will return process ID # Command & … Read more

Kaltura Red5 iOS Live Streams Setup

We have a plugin that can be used for streaming kaltura live red5 rtmp to mobile devices. Kaltura Red5 Live Plugin take below data to segment live video stream – Red5 Live Video RTMP Stream Link – Red5 Stream Name – Publishing Folder – Publishing Link The Main feature of this plugin to show live … Read more

Free Cloud Storage Services

Cloud Storage is really a buzz word for people who are facing troubles for backups and data loss. Cloud Storage can provide tension free management of data on the fly. You can choose any cloud program below as free storage. I really like Dropbox, it is available for all devices 😉 Dropbox – Free for … Read more