Home » Archive

Articles tagged with: PHP

PHP, Software »

[20 Aug 2009 | View Comments | 50 views]

Regular expressions are a very useful tool for developers. They allow to find, identify or replace text, words or any kind of characters. In this article, I have compiled 15+ extremely useful regular expressions that any web developer should have in his toolkit.

PHP, Software, featured »

[20 Aug 2009 | View Comments | 195 views]
Path variables in PHP

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.

Uncategorized »

[21 Jul 2009 | View Comments | 44 views]

I am going to post very handy tip for javascript and css files caching. Browsers automatically cache the css and JS files and when you make change to CSS and JS some times change does not appears.
To prevent this use following
<?php
echo ‘<link rel=”stylesheet” type=”text/css” href=”style.css?’ . filemtime(’style.css’) . ‘” />’;
?>
And For JS
<?php
echo ‘<script type=”application/javascript”=”main.js?’ . filemtime(’main.js’) . ‘” />’;
?>
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 …

Linux, PHP »

[7 Jul 2009 | View Comments | 80 views]

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 …

Cakephp, Linux, PHP »

[25 May 2009 | View Comments | 204 views]

Hi friends,
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 …

Linux, PHP »

[16 Jan 2009 | View Comments | 49 views]

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
The linux command for this task is
$ chown -R username:usergroup directory
enjoy