Friday 17 February 2012

Joomla 1.5.25 : URLs get redirected to home page


We had a problem with a Joomla 1.5.25 site. whenever we clicked on any of the links in the Main Menu, the site shows only the Home Page.

We turned off SEF URLs from the Administrator Module. That did not work.

Then when we checked the apache log the problem was identified.


The log showed the following error :

warning: preg_match() [function.preg-match]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in 

The pcre status was checked using

pcretest  -C

The Output was :

Compiled with
UTF-8 support
Unicode properties support
Newline sequence is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000

Match recursion uses stack

Even though pcre was compiled with UTF-8 support, Apache was using the pcre which came with the PHP library (which is an older version).

So Apache was recompiled with the option '--with-pcre=/usr'.

This solved the problem and the URLs were working properly.

Thursday 16 February 2012

Shrinking MS-SQL Database

Normally shrinking a database increases performance and reduces size only by a small margin.

The following process helps to shrink the database and increases performance by a huge factor.


1 - Take  Transaction Log  backup twice.

2 - Then shrink the Database.

Saturday 4 February 2012

Errors while installing PHP from source (RHEL 5)

Following were some of the errors (and their solutions) that I had to face while installing PHP from source tarballs. The solutions are described with the assumption that the yum repository is already configured.


Configure: error: Cannot find openssl's <evp.h>

# yum install openssl-devel


Could not find pcre.h in /usr

# yum install pcre-devel


Configure: error: Please reinstall the BZip2 distribution
# yum install bzip2-devel


Configure: error : Please reinstall the libcurl distribution.

# yum install curl-devel


DBA: Could not find necessary header file(s)

# yum install db2-devel


Configure: error: Unable to locate gmp.h

# yum install gmp-devel


Configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information

# yum install libc-client-devel


Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
# yum install postgresql-devel


Configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

# yum install libxslt-devel


Configure: error: freetype.h not found

# yum install freetype-devel


Configure: error: Cannot find ldap.h

# yum install openldap-devel


Could not find pspell

# yum install aspell-devel


Configure: error: xml2-config not found. Please check your libxml2 installation.
# yum install libxml2-devel


Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!

Install the MySQL-devel package corresponding to your MySQL version


Checking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found!

# yum install unixODBC-devel


Configure: error: snmp.h not found. Check your SNMP installation

# yum install net-snmp-devel


Note :- The following error occur while performing 'make'

php-5.3.9/sapi/cli/php: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] Error 127


The solution was the libpq.so.5 library file which was present inside the lib directory of the PostgreSQL installation directory was copied to /usr/lib64



Friday 3 February 2012

Content Display Problem in Joomla with PHP 5.3.9

While running Joomla applications using PHP 5.3.9, the contents or aticles may not be displayed properly. There is a simple work around for this glitch.

Go to  Joomla application folder > includes > Cache > Lite

Open the file Function.php for editing.

Go to line number 74

Replace the code :

$arguments = func_get_args();


with



 $arguments = func_get_args();
 $numargs = func_num_args();
 for($i=1; $i < $numargs; $i++)
        {
             $arguments[$i] = &$arguments[$i];
        }


Now your articles will be properly displayed on the Joomla site.