Jump to Navigation


132 - php-mssql extension

You have noticed on RedHat & CentOS, there is no PHP-MSSQL module/extension available in the default yum repositories.
So if you want to use it, you can search php-mssql and download it from the follwoing URL. You do not configure ODBC or use sybase extension.

URL: http://rpm.pbone.net/

Example :

# yum install php-mssql-5.1.6-5.el5.x86_64.rpm

119 - To install the PECL uploadprogress library

IThe report of drupal site says that the upload progress module gives you an error.

The error is the following:

"Upload progress Not trained Your server is capable of displaying file upload progress,
but does not have the required libraries.
It is recommended to install the PECL uploadprogress library (prefered) or to install APC."

You need to install the PHP developer package.

$ sudo apt-get install php5-dev

( CentOS, Redhat : $ yum install php-pear )


088 - How to install mcrypt for PHP in ubuntu

Initially ubuntu server (LAMP) does not  include mcrypt for PHP. To install it, the following steps need to be done.

apt-get install php5-mcrypt
/etc/init.d/apache2 restart

Sometimes you might get the message “php5-mcrypt is already the newest version“. If so, install with:

061 - extract() function

The extract() function converts elements in an array into variables in their own right, an act commonly called "exporting"
in other languages. Extract takes a minimum of one parameter, an array, and returns the number of elements extracted.
The following example is useful for retriving information from database.



049 - How to call a Perl script from PHP

The exec() function is best-suited for executing an operating system-level application intended
to continue in server background. Even there is a perl script you want to execute, it is easy to do that.

Perl script (languages.pl) :

045 - How to use clearstatcache(), stat()

When you use stat(), istat(), or any of the other functions listed in the affected functions list ,PHP caches the information those functions return in order to provide faster performance. However, in certain cases, you may want to clear the cached information. You can use the clearstatcache() function to clear the information that PHP caches about a file.


040 - PEAR

PEAR is a framework and distribution system for reusable PHP components and presently offers more than 400
packages categorized under 37 different topics.

Installing PEAR on Linux:

lynx -source http://go-pear.org | php

Installing PEAR on Windows:


%>pear list   (Viewing the packages installed on your machine.)

%>pear info Console_Getopt  (Learning more about an installed PEAR package)

001 - mysql_connect() and mysql_pconnect()

There is a difference between mysql_connect() and mysql_pconnect().

* mysql_connect()
This opens a connection to a MySQL Server. The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close().


002 - About require(),include(),include_once()

* require():
If there is an error pf "missing a file", this statement immediately stop processing, but include() does not behave this way, the PHP script will continue regardless.

* include():
This statement includes and evaluate the specified file during the execution of the script. If not found a file, the script will continue.

Subscribe to RSS - function

Main menu 2

by Dr. Radut