Guide Center Download videos and enjoy them offline!
- Totally FREE Video Converter for All Multimedia
- Support AVI, MP4, 3GP, MPEG, WMV, FLV, and even HD MOV, MKV, M2TS, MTS, etc
- Try Free Video Converter - Convert Video for All Popular Devices ⇒
Who may need this article:
If you have interest on running your video hosting services, you wanna create your own video sharing site on Linux server with thousands upon thousands of visitors and video clips hosted just like YouTube, iFilm, Break or other famous video sharing sites do, this tutorial will tell you how to make the first step.
What’s needed:
- Sothink Video Encoder Engine for Adobe Flash (Linux Version)
- Apache Server
- PHP
- MySQL
- JavaScript
- Sothink Video Encoder for Adobe Flash
This is about:
- How to build a video hosting site with php
step1 Install Apache Server and PHP
step2 Setup Directories and Files
step3 Configure PHP
step4 Setup MySQL Database
step5 Test Your Web Site
- Create a Flash video player
step1 Installation of Sothink Video Encoder for Adobe Flash
step2 Create a Flash Video Player
step3 Deploy the Flash Video Player
- Screenshots
How to build a video hosting site with php
Step1 Install Apache Server and PHP
Install Apache Server
Please download the Apache server from the Apache Software Foundation and follow this document to know how to install, configure and run Apache under Linux.
Install PHP
PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Please download PHP from http://www.php.net and follow the installation and configuration guide to know how to install and configure PHP.
Step2 Setup Directories and Files
- Log on to your server with root account.
- Download Sothink Video Encoder Engine for Adobe Flash (Linux Version) from our Web site. You will get a file named "fvec.tar.gz".
- Download additional codecs from our Web site. You will get a file named "mencoder.tar.gz".
- Create a directory "fvec" under /usr/bin:
# mkdir /usr/bin/fvec - Extract all the files from fvec.tar.gz and mencoder.tar.gz to the directory /usr/bin/fvec.
# tar xvfz fvec.tar.gz -C /usr/bin/fvec
# tar xvfz mencoder.tar.gz -C /usr/bin/fvec - Use the following command to assign execution permission to users:
# chmod 755 /usr/bin/fvec -R - Download the PHP source of the demo site from our Web site and you will get a file named "php-demo.tar.gz"; Extract all the files to a sub-folder under your www root, for example, /var/www/html/php-demo.
; Create the directory
# mkdir /var/www/html/php-demo
; Extract the files
# tar xvfz fvec-php-demo.tar.gz -C /var/www/html/php-demo
; Assign permissions
# chmod 777 -R /var/www/html/php-demo
- To prevent users from uploading executable files to the directory "/var/www/html/php-demo/files" and executing them, please open the file httpd.conf in the conf folder of Apache and insert the following lines to deny the execution of files in this folder.
# vi /etc/httpd/conf/httpd.conf
<Directory /var/www/html/php-demo/files>
php_flag engine off
</Directory>
You should change some php.ini directives to make the demo site work properly. Generally, php.ini is in the directory /etc. The demo site uses some new functions availabe since PHP 4.3. If you use older versions, please upgrade to version 4.3 or later. Please check the PHP configuration document for details.
; Enable file uploading:
file_uploads = On
; Setup the temporary directory used for storing files when doing file upload. The directory must be writable by whatever user PHP is running as.
upload_tmp_dir = /var/tmp
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
; Maximum size of POST data that PHP will accept. This value should be larger than upload_max_filesize because extra data will be posted while uploading.
post_max_size = 30M
Save php.ini and restart Apache to make the changes take effect.
# /sbin/service httpd restart
- Open the file in your browser: http://yourdomain/php-demo/installdb.php
- Input the server name, user name and password of the of MySQL server.
- Click install to start the setup process.
If succeeded, a database named "fvec" and a table named "VIDEOS" will be created in MySQL. A file 'db.php' will also be created in the current directory (/var/www/html/php-demo).
To test the site, please open your browser and navigate to "http://yourdomain/php-demo/upload.htm".
If everything goes well, you can upload video files to your server and encode them now. To view our demo site, please visit http://flv-encoder-linux.sothinkmedia.com.
Create a Flash video player
Installation of Sothink Video Encoder for Adobe Flash
After purchasing Sothink Video Encoder Engine for Adobe Flash (Linux Version), you can get Sothink Video Encoder for Adobe Flash Windows GUI version for free. With the Windows GUI version, you can make customized Flash Video Players for general use on your video hosting and sharing server.
System Requirements: Windows 2000 / XP / 2003 / Vista
How to install
- Download Sothink Video Encoder for Adobe Flash from our web site.
- Extract the ZIP file to your hard disk
- Run Setup.exe and follow the wizard to install the software.
- Launch Sothink Video Encoder for Adobe Flash by double-clicking the program icon on your desktop.
- Enter the registration key to register the software. If you have not get the registration key yet, please send your registration information of Sothink Video Encoder Engine for Adobe Flash (Linux Version) to support@sothinkmedia.com and we will send you the registration key then.
Create a Customized Flash Video Player
- Launch Sothink Video Encoder for Adobe Flash by double-clicking the program icon on your desktop.
- Select any video file and click "Next".
- In the "Encoding preferences" page, change the "Width" and "Height" to desired values, then click Next.
- In the "Select output folder and files" page, check "Generate SWF" and uncheck "Generate FLV", "Generate HTML" and "Generate thumbnail". Enter "player.swf" as the name of the output SWF file. Select "Get FLV path from a URL variable and play progressively" and enter "flv" as the name of the URL variable. You can also change the playback settings as you like. Click "Next" after done.
- In the "Select play control skin" page, check "Use a skin" and select a desired skin. You can also specify a color scheme for the skin and adjust the saturation of the color.
- Click "Next" and a file name "player.swf" will be created in the specified folder.
- Find the file "player.swf" created in the previous steps in Windows Explorer.
- Copy the file "player.swf" in to the folder of the PHP demo site and overwrite the old one.
- Now you can upload a video and test the created Flash Video player on your web site.
Screenshots


If you have any questions about this tutorial, please contact us. We will reply as soon as possible.

