Many of you develop php applications for multiple server environment. Webserver environment may be different, have different directory structure, so you have to use paths very carefully. For example in file upload script, you manually write absolute path of image directory, the application may not work on other server. To avoid this you should use inbuilt php path variables. I am posting summary of all php related path variables.

The PHP function filemtime returns last modified date of file, so every time you make change in css / JS files the filemtime will return different value and CSS / JS Url will change and browser will refresh CSS / JS file.

Recently I faced a big problem with large file uploads. One of my client has a Centos5 dedicated server. I created a script for Video upload and conversion. I also added a progress bar to show file upload progress. This progress bar has limit of 100MB because of flash limitation. Everything was working fine for files less than 50MB, but as size grows the upload hangs on 20 – 30%.. I did every thing in php.ini and apache.conf but nothing helped. I wrote to server admin at least 50 times and finally they giveup! Now I has no solution.

I start searching on net and found uberUploader. This is the most comprehensive uploader available on net. You don’t even need to set php.ini settings, because the uploading part handled by Perl. This resolved my problem. Now I can upload 1GB file This has a bunch of uploading configuration option. This also has nice progress bar.

2 days ago I got a project in which I have to upload avi, mpeg or 3gp movie clip and convert this clip to flv as well generate thumbnail for this video. I know that this can be done through ffmpeg. But I didn,t know how haha..

Well I searched enough and start making environment for development. I did following mistakes.. I am listing those mistakes. I am 100% sure it will save your day.

I was using Windows environment: FFmpeg is primarily made for Linux environment not for windows. Some experts developed windows version of ffmpeg. Some functions are unavailable in windows version. SO I suggest you to use Linux environment.

I thought that only ffmpeg can do everything: FFmpeg is a command line tool to do video related task (only video) such as clipping, video conversion, frame extraction etc. But for the sound, watermarking you have to use other packages too. I will tell about these details later.

php-ffmpeg and ffmpgeg: I was very much confuse between php-ffmpeg and ffmpeg. I after 30 minutes of googling I came to know that ffmpeg-php is extension for php which provide handy functions to convert videos and if you use ffmpeg then you have to use exec() command to execute ffmpeg commands.

Recently I came across following when deploying webapplication on Linux serevr…
SoftException in Application.cpp:303: UID of script “/home/xyz/public_html/en/pupgrade.php” is smaller than min_uid
The problem was file owner and group as root (I was uploading file through root account)
Solution: change file owner and group to webhoting user.. generally it is your user name..
/home/[user]/public_html/en/pupgrade.php