Tag Archives: install

PHPmotion installation

PHPmotion is a free video sharing software that also has support for other types of media such as audio/mp3 sharing. The Content Managent System or (media cms application) will allow you to create and run your very own Video Sharing website, Music Sharing Site, Picture Sharing Site.

Servers – Linux/Unix server
- PHP 4.3 and above (including support of CLI)
- MySQL database server
- LAME MP3 Encoder
- Libogg + Libvorbis
- Mencoder and also Mplayer
- FFMpeg-PHP
- GD Library 2 or higher
- Be able to run background processes

PHP Settings
- open_basedir = (no value)
- upload_max_filesize = 100M
- post_max_size = 100M
- max_execution_time = 1500
- session.gc_maxlifetime = 14000
- safe_mode = off
- Thread saftery = disabled
- enable_dl = On

Libraries installation
Follow the steps on this page.

phpSHIELD loader
With this error:
PHP script /var/www/*/classes/config.php is protected by phpSHIELD and requires the phpSHIELD loader phpshield.5.3.lin. The phpSHIELD loader has not been installed, or is not installed correctly. Please visit the phpSHIELD php encoder site to download required loader.
Follow the steps on this page.

With this error:
PHP Fatal error: SourceGuardian Loader - This protected script does not support version 5.3.2-1ubu of PHP. Please contact the script author about this problem. Error code [07] in /var/www/*/classes/config.php on line 2
Assuming you have old revision installed, you need to update / upload 4 files from the php5.3 release (or download here)

Other error infamous
White screen

  • The following files MUST be uploaded in Binary mode
    /phpshiled/all files in this folder
  • Set error_reporting to E_ALL or into apache configuration
    LogLevel debug
  • Set Thread Safety to disable (follow the steps on this page)
  • Your revision is too old that you must install last revision:
    • Backup your database and /upload and your /themes/*/templates directories
    • Install new release
    • Use old database during new intallation
    • Copy old /upload and your /themes/*/templates directories

Reference: PHPmotion System Requirements, PHPmotion Forum

FFmpeg, FFmpeg-PHP, Lame, Libogg, Libvorbis, FLVtool2, Mplayer, Mencoder, AMR Installation

apt-get update
apt-get upgrade
apt-get install libjpeg-progs libjpeg62 libjpeg62-dev libsdl1.2-dev php5-dev build-essential subversion ruby libcurses-ruby git-core yasm unzip

Download all the files needed
cd /opt/phpmotion
wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-
wget http://downloads.xiph.org/releases/theora/libtheora-1.1beta3.tar.gz
wget http://www8.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Extract all the files
tar zxvf lame-3.99.5.tar.gz
tar zxvf libogg-1.3.0.tar.gz
tar zxvf libvorbis-1.3.3.tar.gz
bzip2 -cd amrnb- | tar xvf -
bzip2 -cd amrwb- | tar xvf -
tar zxvf libtheora-1.1beta3.tar.gz
tar jxvf ffmpeg-php-0.6.0.tbz2
tar zxvf flvtool2-1.0.6.tgz
tar jxvf essential-amd64-20071007.tar.bz2

Install lame
cd /opt/phpmotion/lame-3.99.5
./configure && make && make install

Install libogg
cd /opt/phpmotion/libogg-1.3.0
./configure && make && make install

Install libvorbis
cd /opt/phpmotion/libvorbis-1.3.3
./configure && make && make install

Install flvtool2
cd /opt/phpmotion/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Copy Codecs for mplayer
mkdir /usr/local/lib/codecs
mv /opt/phpmotion/essential-amd64-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
We also need to secure the tmp directory
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp

Install mplayer & mencoder
cd /opt/phpmotion/mplayer
svn update
./configure --enable-jpeg
make && make install

Install AMR (for 3gp conversion)
Debian Lenny and Ubuntu 10.04 users, not install AMR packages
cd /opt/phpmotion/amrnb-
./configure && make && make install
cd /usr/local/src/amrwb-
./configure && make && make install

Install libtheora (for ogg video encoding)
cd /opt/phpmotion/libtheora-1.1beta3
./configure && make && make install

Install ffmpeg
cd /opt/phpmotion/ffmpeg/
svn update
Debian Lenny and Ubuntu 10.04 users please use the following configure command:
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --enable-nonfree --enable-libtheora
Debian Etch and Ubuntu 8.04 users please use the following configure command:
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-libtheoraUbuntu 7.06 users please use the following configure command:
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libtheora
Now run these commands:
make install
ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52
ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52
ln -s /usr/local/lib/libavcodec.so.52 /usr/lib/libavcodec.so.52
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
ln -s /usr/local/lib/libamrnb.so.3 /usr/lib/libamrnb.so.3
ln -s /usr/local/lib/libamrwb.so.3 /usr/lib/libamrwb.so.3

Install ffmpeg-php
Debian Lenny and Ubuntu 10.04 users please use the following configure command:
aptitude install php5-ffmpegOthers Debian and Ubuntu users please use the following configure command:cd /opt/phpmotion/ffmpeg-php-0.6.0/
./configure && make && make install
You now check if there is ffmpeg-php module:
grep -R ffmpeg /etc/php5/*
If there is not, then you now need to add the new ffmpeg-php module to the php.ini file
nano /etc/php5/apache2/php.ini
extension=ffmpeg.so (add this line to the end of the file)

Restart & done
/etc/init.d/apache2 force-reload

Reference: linux.justinhartman.com

Installing a SSL Certificate in Plesk

Add a SSL Certificate to a website using Plesk it is simple: it is important to know Plesk version because it is different among differente releases.
Plesk 9

  1. we first login to Plesk and navigate to the domain you wish to install the Certificate on to
  2. enter into the configuration of the target domain
  3. click on SSL Certificates
  4. click on Add SSL Certificate
  5. if you already have a SSL Certificate then you can skip this step and go to step 8. Any details:
    1. Name the certificate. This can be named anything that you choose. You could use a descriptive name including a timestamp like YYYYMMDDRR format where RR is the revision number (00 in this case as there are no revisions for the same day)
    2. Make any needed adjustments to the SSL Request. This information will be embedded in the SSL Certificate and should be similar to the domain registration information
    3. The email address should match one of the email addresses in the domain whois information provided by your domain registrar
    4. Falsified information may be rejected by your SSL Certificate Authority.
  6. now enter back into the Certificate configuration
  7. you can now review the CSR and Private Key. Save the Private Key in a safe location. Should anything occur with your server that the certificate must be re-entered you MUST have at least the Certificate and Private Key. Take the CSR and submit it to the Certificate Authority of your choice
  8. once you have received the Certificate from your Certificate Authority you can paste it into the Certificate text area. If your Certificate Authority requires, you may need to paste their own Certificate into the CA certificate text area (often called a CA Bundle)
  9. if the Private Key does not match the Certificate then you will see a page similar to this. You MUST have a matching Private Key and Certificate in order to use a Certificate
  10. once installed you will see CSR, Private Key and Certificate. These three all match up and are ready to be used
  11. now you will navigate back in to the Web Hosting Settings from the Domains configuration
  12. select the corresponding Certificate and click OK at the bottom

Plesk 9.5
Previous steps do not work. Certificate must be adding into Global Configurations and not into single domain configuration.

  1. we first login to Plesk and enter into the Global Configuration
  2. click on SSL Certificates and follow steps (about Plesk 9) from 4 to 10
  3. now you will navigate back in to the IP addresses
  4. you need exclusive IP addresses for domains with SSL certificates. Enter into IP address about your website to apply the SSL Certificate
  5. select SSL Certificate (choose name about certificate newly created)
  6. select domain and save
  7. follow last steps (about Plesk 9) 11 and 12

The new certificate is now being used for the domain. If you have updated the certificate then you may need to completely close out of your browser before the new certificate is used.

Reference: modularmerchant.com, parallels.com

PHP PEAR installation and configuration

PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide:

  • A structured library of open-source code for PHP users
  • A system for code distribution and package maintenance
  • A standard style for code written in PHP, specified here
  • The PHP Extension Community Library (PECL), see more below
  • A web site, mailing lists and download mirrors to support the PHP/PEAR community

There is not important what it is your OS: you could download http://pear.php.net/go-pear to begin installation.
wget http://pear.php.net/go-pear
mv go-pear go-pear.php
php go-pear.php

or simply:
aptitude install php-pear (Debian / Ubuntu)
yum install php-pear (Fedora / Centos)

Verifying the include path
To use PEAR and PEAR compatible packages in your applications, you normally include them into your PHP scripts using require_once(). For this to work, PEAR’s php_dir must be a part of PHP’s include path.
1. First, check where PEAR installs .php files:
pear config-get php_dir
mine output is:
This directory will contain System.php.
2. Now it’s time to find which configuration file is used by your PHP installation. On command line, execute:
php --ini | grep Loaded
mine output is:
Loaded Configuration File: /etc/php.ini
To see which php.ini is used by PHP on your web server, create a file with only as the contents, and save it in your local web root as check_php.php. Open the file in your browser as http://localhost/check_php.php, to find the path to the php.ini file your web server is using.
3. include_path about php.ini must include php pear directory:
grep include_path /etc/php.ini | egrep "^[^;]"
mine output is:
include_path = ".:/usr/local/php/pear/"
If your include_path does not contain php pear directory, then you must add it modifying php.ini.
Modifying php.ini
To get PEAR working properly, you need to adjust PHP’s include_path. After you found php.ini, open it in an editor.
Search for the line include_path.
Now that you found it, you probably will see a semicolon ; at the beginning. This means the line is a comment. Add a new line below it.
In this line, write:
Depending on your operating system, add a : (Unix/Linux/FreeBSD/Mac OS X) or a ; (Windows) after the dot. Add PEAR’s php_dir after it. (The directory System.php is located in!)
The result should look like that:
; Unix

; Windows

Checking if PEAR works
Now that this is done, try including a file. Create a new check_pear.php file with the following contents:

require_once 'System.php';

System.php is shipped with every PEAR installation and thus should be on your computer, too. Open the file with the browser from your web server, and also try it on command line:
php check_pear.php
The only output should be
A message like:
Warning: require_once(System.php): failed to open stream:
No such file or directory in /path/to/check_pear.php on line 2

means that your include path is not correct. (So go and fix it!)
Installing packages
After getting PEAR working on your machine you most likely want to install some packages. This guide shows people new to the PEAR command line installer how to get started. The general command to install a PEAR package named “foo” is
pear install foo
Typing this and pressing return, the package will be downloaded and installed on your computer. It does not matter if you write the package name in lowercase, UPPERCASE or MixedCase – the installer will find the package by lowercasing the name.
When a package is already installed, you will get the following message:
pear install foo
Output is:
Ignoring installed package pear/foo
Nothing to install

This happens even if there is a newer version of the package! The correct command to upgrade to the lastest version is
pear upgrade foo
Output is:
upgrade ok: channel://pear.php.net/Foo-1.2.3
If the package already has the lastest version, you will get a message similar to the following:
Ignoring installed package pear/Foo
Nothing to upgrade

In the case you deleted some file and really really want to re-install the package, you have two choices:

  • Uninstall the package, and reinstall it afterwards
  • Force the installation

Forcing an command should only be done when you absolutely know what you are doing – you might in some circumstances break PEAR otherwise. Forcing something should always be the last option.
pear install -f foo
pear upgrade -f foo

Unstable alpha/beta packages
Now and then, you will get error messages like

Failed to download pear/foo within preferred state "stable",
latest release is version 0.1.2, stability "beta",
use "channel://pear.php.net/foo-0.1.2" to install
Cannot initialize 'channel://pear.php.net/foo', invalid or missing package file
Package "channel://pear.php.net/foo" is not valid
install failed

Reason for this is that PEAR by default installs stable packages only. When a package is in state devel, alpha or beta it will refuse to install them. You can easily persuade it by adding either the version number or the stability you are willing to accept:
pear install Foo-beta
pear install Foo-alpha

You can also install a specific version, or upgrade to a specific version regardless of the state:
pear install Foo-1.2.3
pear upgrade Foo-1.2.3

Verifying the open basedir
It may happen that from the command line php pear works and via browser no. In the apache configuration file of domain may need to add:

php_admin_value open_basedir "/var/www/domain.my/httpdocs:/usr/local/php/pear/:/tmp"
php_admin_value include_path ".:/usr/local/php/pear/"

Reference: about PEAR, getting started, installing packages, checking if PEAR works, mediatemple.net.

Installing msttcorefonts

If you need MS fonts installed in our Linux Operating System, in order to look at the documents in the same way they are looking at it.
on Debian / Ubuntu
sudo aptitude install msttcorefonts
on Fedora / Centos
Install the software needed
sudo yum install rpm-build cabextract
download cabextract package here
Download the specs to build the RPM
wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
Build the RPM
rpmbuild -ba msttcorefonts-2.0-1.spec
wget http://quattorsrv.lal.in2p3.fr/packages/lemon/sl-i386/msttcorefonts-2.0-1.noarch.rpm
Install the RPM
rpm -ivh msttcorefonts-2.0-1.noarch.rpm
Reload xfs
/sbin/service xfs reload
Now the msttcorefonts are installed and available. Look:
yum list msttcorefonts

Reference: sourceforge.net

Jomsocial installation and tips

Would you like create your personal social network? There are more solutions. If you know Joomla, then you could install it and try Jomsocial.

lighthttpd h264 streaming module installation on CentOS

wget http://packages.sw.be/lighttpd/lighttpd-1.4.28-1.el5.rf.i386.rpm
wget http://packages.sw.be/lighttpd/lighttpd-fastcgi-1.4.28-1.el5.rf.i386.rpm
wget http://ftp.heanet.ie/mirrors/pld-linux/dists/2.0/updates/general/i386/lighttpd-mod_h264_streaming-1.4.28-1.i386.rpm
rpm -ivh lighttpd-1.4.28-1.el5.rf.i386.rpm
rpm -ivh lighttpd-fastcgi-1.4.28-1.el5.rf.i386.rpm
rpm -ivh --nodeps lighttpd-mod_h264_streaming-1.4.28-1.i386.rpm

Edit file /etc/lighttpd/lighttpd.conf and modify server.use-ipv6 value in disable. I f you could dedicate one IP, uncomment server.bind and change localhost with IP dedicated.
Edit file /etc/lighttpd/modules.conf and:

  • comment all modules in server.modules
  • in server.modules, add line:
  • below server.modules, add lines:
    h264-streaming.extensions = ( ".mp4", ".f4v" )
    h264-streaming.buffer-seconds = 10

Start your new web server:
service lighthttpd start
Add web server in runlevel:
chkconfig --add lighttpd
For testing purposes we recommend a tool like wget, or curl):

  • upload one f4v video to the document root of your website:
    wget sample.f4v
    cp sample.f4v /srv/www/lighttpd/
  • download the full file:
    wget -O test.f4v "http://localhost/sample.f4v"
  • download file with specify start time:
    wget -O test.f4v "http://localhost/sample.f4v?start=45.5"
    This saves a file (test.f4v) on your local disk that will have the first 45.5 seconds removed from the original (sample.f4v) video

You can use your favorite player to see if worked okay.

Reference: installation and testing

Red5 installation


  • Download and Install Java. RED5 server depends on Java. CentOS 5.3 comes with OpenJDK 1.6 and install it using yum.
    yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
  • Download and Install Ant (Apache Project). Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.

    cd /usr/src
    wget http://mirrors.kahuki.com/apache/ant/binaries/apache-ant-1.8.0-bin.tar.bz2
    tar jxvf apache-ant-1.8.0-bin.tar.bz2
    mv apache-ant-1.8.0 /usr/local/ant
  • Export Variables for Ant and Java

    export ANT_HOME=/usr/local/ant
    export JAVA_HOME=/usr/lib/jvm/java
    export PATH=$PATH:/usr/local/ant/bin
    export CLASSPATH=.:$JAVA_HOME/lib/classes.zip

    Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.

    export ANT_HOME=/usr/local/ >> /etc/bashrc
    export JAVA_HOME=/usr/lib/jvm/ >> /etc/bashrc
    export PATH=$PATH:/usr/local/ant/ >> /etc/bashrc
    export CLASSPATH=.:$JAVA_HOME/lib/classes. >> /etc/bashrc
  • Download and Install RED5 Server. Here the latest version available for RED5 is 0.7 on site but download from google code using svn as the tarball of 0.7 on site is missing some of the files.

    cd /usr/src
    svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
    mv red5 /usr/local/
    cd /usr/local/red5
    ant prepare
    ant dist
  • you will see a ton of lines, but you should get at last


    this mean its install and now copy the conf directory from dist/ and test the red5 installation.

    cp -r dist/conf .

    If it shows Installer service created in the last then everything is fine here, press ctrl+c and move to next step to create init script.


  • Before beginning this make sure you are running these commands as root. Install Subversion:
    apt-get install subversion
  • Install tools to build your own Debian packages:

    apt-get install dpkg-dev
    apt-get install debhelper
    apt-get install dh-make
    apt-get install devscripts
    apt-get install fakeroot
  • Install Java (see this tutorial for more info):
    apt-get install java-package
  • Install Apache Ant 1.7:

    wget http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.0-bin.tar.gz
    gzip -d xf apache-ant-1.7.0-bin.tar.gz
    tar -xf apache-ant-1.7.0-bin.tar
    cd apache-ant-1.7.0
    mv apache-ant-1.7.0 /usr/local/ant
    export ANT_HOME=/usr/local/ant
  • Once Java and Ant are all set up you simply download the latest development version of Red5 to your box.
    svn co http://svn1.cvsdude.com/osflash/red5/java/server/trunk red5-trunk

    That will create a folder in your current directory called red5-trunk.
  • Navigate to the red5-trunk directory and run
    That will build the project on your machine.
  • At this point you will need to create a red5 directory in the /usr/local/red5 directory.

    mkdir /usr/local/red5
  • Then you will want to copy the contents of the dist(distribution) folder to /usr/local/red5 like so
    cp -R red5-trunk/dist/* /usr/local/red5/
  • We need need to fix the permissions on the red5.sh file:
    cd /usr/local/red5
    chmod 755 red5.sh
  • To run the server you have a few options using the red5.sh file. Run the server by either running
    sh red5.sh &
    ./red5.sh &

    This will start the Red5 service manually.
  • Verify the correct ports are being bound to:
    netstat -ant


sudo apt-get update
sudo apt-get install subversion
sudo apt-get install java-package
sudo apt-get install sun-java6-jdk
sudo apt-get install ant
mkdir -p ~/svn/red5
cd ~/svn/red5
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5-read-only
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export ANT_HOME=/usr/share/ant/
cd ~/svn/red5/red5-read-only
sudo mkdir /usr/share/red5
cd ~/svn/red5/red5-read-only/dist
sudo cp -R * /usr/share/red5/
cd /usr/share/red5
sudo chmod 755 red5.sh
/usr/share/red5/red5.sh &

Digit on browser: http://localhost:5080 and good luck!

Init Script
Now we will create init script for red5 to start, stop and restart easily.
wget http://ittips.pandle.net/download/script/bash/red5.txt
cp red5.txt /etc/init.d/red5
chmod 755 /etc/init.d/red5

Reference: corsidiinformaticaonline.it, red5server.org, sohailriaz.com

php5 update on CentOS

If you have CentOS v5.2 then you have PHP v5.1.6. Any PHP5 systems need PHP5 > v5.2.
The php-sqlite2 library has a problem to update so that you must delete it:
yum erase php-sqlite2
Now, you have got any solutions:

    Update PHP5 to last stable version and create /etc/yum.repos.d/CentOS-Testing.repo with this content:

    name=CentOS-5 Testing

    Update PHP5 to last beta version and create /etc/yum.repos.d/utterramblings.repo with this content:

    name=Jason's Utter Ramblings Repo

Now, you could update system:
yum update

Reference: wiki.centos.org and jasonlitka.com

php-mcrypt installation on CentOS

Updating/Installing mcrypt
If you have php-mcrypt for PHP 5.1.x installed you’ll want to remove it:
Note: Your version number maybe different. Alter below command accordingly.
rpm -e php-mcrypt-5.1.6-15.el5.centos.1
Download php-mcrypt for PHP 5.2.x and install it. You can find a 32-bit php-mcrypt package here FedoraJunkies.
Note: You’ll notice the “–nodeps” flag in the example. When you try to install php-mcrypt without it you get an error that php-common-5.2.6-2.el5s2 is missing even though it is installed.
wget -c http://sourcemirrors.org/scotth/centos/5/php/php-mcrypt-5.2.6-2.i386.rpm
rpm -i --nodeps php-mcrypt-5.2.6-2.i386.rpm

Restart Apache and you should now see mcrypt information on your testing.php page.

System installs library and creates /usr/lib/php5/../mcrypt.so
Check if mcrypt.ini file exists or create it in /etc/php5/conf.d and added this one liner:

Reference: wiki.centos.org, php.net