swargamswargamswargamswargam

Friday, 8 August 2008

I get Uploading file error when uploading audio/video files in Ray Media and Video Players

1) This is a common problem and most of the time it is caused by the following reasons:

1) You're trying to upload files bigger than 2 Megabytes which is the default value for PHP configuration. To fix it, edit php.ini file which is used as a configuration file by your PHP processor. You have to find two variables: upload_max_filesize and post_max_size and assign bigger values to them.

2) You don't have .htaccess or have it corrupted in the ray folder. Here's the code that this file must contain:


SecFilterEngine off


3) You have the correct .htaccess file but it gets overridden by other Apache settings on your server. You should contact your hosting provider in this case.

4) You don't have the proper ffmpeg.exe in ray/modules/global/app or it doesn't have 777 permissions (readable, writable, executable). In this case change the permissions and make sure the ffmpeg.exe file is applicable to your operating system: Linux (provided with Dolphin), Windows or FreeBSD.

5) You have incorrect permissions for the following folders:

ray/modules/mp3/files/, ray/modules/movie/files and ray/modules/music/files These folders must have 777 permissions.

6) You have PHP exec() function disabled on your server. Advise with your hosting provider in order to figure this out.

2) If you still can't make it work, please follow this diagnostic procedure:

* To determine the reason of such problems, create a php file with the following contents, upload it in your Dolphin's root directory and run it in your browser window:

echo "
PHP INI settings
";
echo "
safe mode = ".ini_get('safe_mode');
echo "
disabled functions = ".ini_get('disable_functions');
echo "
max execution time = ".ini_get('max_execution_time');
echo "
post_max_size = ".ini_get('post_max_size');
echo "
upload max filesize = ".ini_get('upload_max_filesize');

echo "

ffmpeg output";
$s = realpath("ray/modules/global/app/ffmpeg.exe");
echo `$s -version 2>&1`;

Output analysis:

safe_mode = if this variable has non-empty value then ffmpeg will not be able to execute; in this case advise with your hosting about disabling safe mode.

disabled_functions = if this variable contains exec then this function is forbidden by hosting and thus your script won't be able to run ffmpeg.

max_execution_time, max_input_time = it's usually set to 30 seconds; you should increase its value several times.

post_max_size = the size of POST data that PHP can handle; it's usually set at 2M; you should increase its value up to 8M or more.

upload_max_filesize = the size limit of uploaded files; it's usually set at 2M; you should increase its value up to 8M or more.

ffmpeg output: - this command will result in a message like this:

FFmpeg version SVN-r9115, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-libmp3lame --enable-xvid --enable-x264 --enable-gpl --enable-libvorbis --enable-libogg --enable-libtheora --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaad --enable-libfaac --enable-pthreads --disable-shared --enable-static
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Aug 14 2007 18:26:46, gcc: 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)
ffmpeg SVN-r9115
libavutil 3212288
libavcodec 3352580
libavformat 3345409

If you didn't see anything like this your hosting doesn't allow your web script to run exe files (this can be the result of safe_mode and disabled_functions values, see above).

Possible ways to fix this problem:

* safe_mode and disabled_functions issues can be resolved only by hosting provider.

* There are 2 ways to resolve the issue with max_execution_time:

1) Create .htaccess file in Dolphin's root directory (or edit the existing .htaccess file) with the following line:

php_value max_execution_time 1000

2) If your hosting doesn't accept commands in .htacces files (such upload solution was implicated in Ray 3.1), add the following line in the ray/modules/movie/inc/functions.inc.php file, after global $sFilesPath; line in function convert:

@set_time_limit(1000);

* upload_max_filesize and post_max_size: create .htaccess file in Dolphin's root directory (or edit the existing .htaccess file) with the following line:

php_value upload_max_filesize 32M
php_value post_max_size 32M

* you should also increase or comment out the value for the wait_timeout variable in the my.cnf file (on Linux) or my.ini file (on Windows) - the configuration file for MySQL; then restart MySQL service.

1 comment:

Cristian said...

i still getting the uploading file error and a did all... help me please