Category Archives: web based

PHPmotion installation

PHPmotion
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
- CGI-BIN
- 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)
/classes/config.php
/includes/mp3_id3_utils.php
/addons/customprofile/index.php
/addons/customprofile/pimp.class.php

Other error infamous
White screen

  • The following files MUST be uploaded in Binary mode
    /phpshiled/all files in this folder
    /classes/config.php
    /addons/customprofile/pimp.class.php
    /addons/customprofile/index.php
  • 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

phpSHIELD Loader

phpSHIELD is a premier php Encoder product. Loaders for phpSHIELD encoded scripts are free to download and install.

Check your servers PHP version. You do this by typing the command:
php -vCheck your system architecture. You do this by typing the command:
uname -i
The result will either be i386 or x86_64. You will need this information to download the correct PHPshield loaders.

Check your PHP extensions_directory. You do this by typing the command:
php -i|grep extension_dirMy path is
extension_dir => /usr/lib/php5/20090626 => /usr/lib/php5/20090626
You must first delete any loaders that may already be in your extensions directory
cd /usr/lib/php5/20090626
rm phpshield.*

Download PHPshield Loaders. You must now download the appropriate PHPshield loader, based on your system architecture. below is a list of the files we have available for download

  • Linux, i386, v5.2.x wget http://downloads.phpmotion.com/phpshield-loaders/32bit/phpshield.5.2.lin
  • Linux, x86_64, v5.2.x wget http://downloads.phpmotion.com/phpshield-loaders/64bit/phpshield.5.2.lin
  • Linux, i386, v5.3.x wget http://downloads.phpmotion.com/phpshield-loaders/linux/i386/ixed.5.3
  • Linux, x86_64, v5.3.x wget http://downloads.phpmotion.com/phpshield-loaders/linux/x86_64/ixed.5.3

v5.2.x
mv phpshield.5.2.lin /usr/lib/php5/20090626/
v5.3.x
mv ixed.5.3 /usr/lib/php5/20090626/
First you need to find out the location of your main php.ini file. This file is the main configuration file for PHP on your server.
You do this by typing the command belowphp -i|grep php.iniYou should get a result that shows something like thisLoaded Configuration File => /etc/php.ini
In the case of our example above, the path we want it /etc/php.ini (others, /etc/php5/apache2/php.ini)
Now run the command below. Remember to use your own php.ini directoy path in the command above
echo "extension=ixed.5.3" >> /etc/php.ini

Restart your web server
/etc/init.d/apache restart
OR
/etc/init.d/apache2 restart

Reference: phpSHIELD PHP encoder, Loaders

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

Debian/Ubuntu
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-10.0.0.0.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-10.0.0.0.tar.bz2
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-10.0.0.0.tar.bz2 | tar xvf -
bzip2 -cd amrwb-10.0.0.0.tar.bz2 | 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-10.0.0.0
./configure && make && make install
cd /usr/local/src/amrwb-10.0.0.0
./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
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/
phpize
./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

Joomla and its customization

Joomla is fantastic because you could add or modify view or calculate intervening into particular events. It only needs to add or modify correct files. If you would like:

  1. modify template
    • creating your template in /templates/your-template-name and
    • overwriting css or html about modules or components
  2. modify modules
    • overwriting html from templates/your-template-name/html
    • from administration, copying module and add it with different parameters
    • copying module and install it as new module
    • changing module by your plugin
  3. add new plugins
  4. add new components

Zoo is a big component. It is so important that it has also more ways to add or modify view or calculate.
If you would like:

  1. modify template
    • from zoo administration interface
    • adding modules into zoo templates (full, related, item, teaser, ..)
  2. modify zoo component
    • from /media/zoo/applications with applications.php files
    • and all final files about full, related, item, teaser, .., templates

Joomla – Plugin load module into article

Load Module plugin
You will usually want to associate modules with articles in some way. The modules are allocated to module positions and the module positions appear somewhere on the Web page as determined by the template. However, it is sometimes useful to have a module actually embedded within the article.

To insert a module inside an article, use the {loadposition xx} command, as follows:

1. Create a module and set its position to any value that doesn’t conflict with an existing template position. You can type in the position value instead of selecting it from the drop-down list. For example, use the position myposition.
2. Assign the module to the Menu Items that contain the articles that you want the module to show in. You can also just assign the module to all Menu Items.
3. Edit the articles where you want this module to appear and insert the text
{loadposition myposition}
in the article at the place where you want the module.

Note that this only works when the Content – Load Module plugin is enabled. If this plugin is disabled, the text {loadposition myposition} shows unchanged in the article.

Load module into article
This plugin loads any module into an article.
Syntax in editor:
{module [27]}
where 27 is the modules id.

Modules Anywhere
With Modules Anywhere you can include a single module or complete module positions anywhere in your site, including inside 3rd party components and even inside other modules.

Why use Modules Anywhere, and not the {loadposition} plugin?
* It works anywhere, not only in articles. It even works in modules!
* You can load a single module, not only complete module positions.
* You can control the html display style from within the tag, not only one global setting.
* You have some security setting, so you can disable this feature for lower user types.
* It comes with a very easy to use editor button.

You can set Modules Anywhere to also handle the {loadposition} tags. In that case, you can safely disable the {loadposition} plugin all together.

Modules Anywhere does not show unpublished Modules by default. If you do want it to, you can change that behavior through the plugin parameters.

Load module into zoo
To load module into zoo content, you could use Modules Anywhere or modify template about zoo.
If you want load module into product catalog, then you could implement ProductApplication class as JPATH_BASE.DS.’plugins’.DS.’content’.DS.’loadmodule.php’ module (with function that return text modified) and use it into template file JPATH_BASE.DS.’media/zoo/applications/product/templates/default/renderer/item/full.php’ with
ProductApplication::your_function($html_content)
where your_function is public function that you implemented (as plgContentLoadModule about loadmodule.php) and $html_content is variable that contain your {loadposition xx}.

Reference: docs.joomla.org, Load module into article, Modules Anywhere

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.

How to moving MU WordPress within your site

Moving the MU WordPress files from one location on your server to another – changing its URL – requires some special care.

WordPress is installed into /wordpress/ default folder and default url is to appear as http://localhost/wordpress/. This howto post is if you want moving from /wordpress/ to /blog/ and you want url to appear as http://localhost/blog/, in MU WordPress system. There are any differences about codex.wordpress.org tutorial.

Here are the step-by-step instructions:

  • modify /wordpress/ folder in /blog/
    • via ssh:

      cd /path-your-main-site
      mv wordpress blog
    • via ftp
    • or via your file manager
  • modify /blog/.htaccess file: change all occurrences of wordpress in blog
  • modify mysql record about site url (MU WordPress 3.0 has not WordPress address in Administration > Settings > General panel):
    mysql -h host -u user -ppassword database -e "UPDATE `wp_options` SET `option_value` = 'http://localhost/blog' WHERE `option_id` =1 LIMIT 1 ;"

If you create subdomain site, you finished. If you have subdomain site:

  • digit on browser http://localhost/blog/ (your main site)
  • go to Super Admin > Sites
  • click Edit about each site and change all occurrences of wordpress in blog

Reference: codex.wordpress.org