configure: error: C++ preprocessor “/lib/cpp” fails sanity check

April 19th, 2009 8 comments

Hello,

If you having trouble compiling any application manually using “configure” , here simple fix for this error.

Error ::

checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

Solution::

  • Centos/Fedora/RHEL
    yum install gcc gcc-cpp gcc-c++
  • Ubuntu/Debain
    apt-get install gcc gcc-cpp gcc-c++

Regards

AlexP

What is the advantge and disadvantage of mysql_connect() and mysql_pconnect() ?

April 16th, 2009 2 comments

mysql_pconnect() will maintain a persistent connection to the database. Whenever your script calls the connect to database function, it first searches already existing connections to the database and if exists it will use the same connection to connect to the database, if not it will open a new connection to the database. ie. Connection is Persistent

where as mysql_connect() function will establish a new connection whenever a connection to database needed, and after executing the script, this function disconnects the connection. ie. connection is not a persistent one.

mysql_pconnect() function is used where your site has a Heavy Traffic and where as mysql_connect() function is used when there is moderate/less traffic to your site.

Regard’s

Alex P

System Administrator.

How to update/install latest RoundCube on cPanel

April 14th, 2009 4 comments

Update/install latest RoundCube on cPanel

First you will have to uninstall/remove exiting RoundCube files/folder/database on your server,

  • Uninstall/remove exiting RoundCube
cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -e 'drop database roundcube';
/scripts/upcp

Now follow the following steps to  update/install latest roundcube  version ,we need to get Roundcube before we can use it. The easiest way to get it is to visit http://www.roundcube.net and click on “Downloads” or just go to http://roundcube.net/downloads. Wait for it to download and then unzip (using WinZip or ZipGenius or tar -xzf roundcubemail-0.1.tar.gz) in the current directory.

  • update/install latest roundcube
cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://nchc.dl.sourceforge.net/sourceforge/
roundcubemail/roundcubemail-0.2.1.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.2.1/ roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs
  • Database Configuration

Create the database, database user and install the intial sql file. The following commands will do this for you.

mysql -e "CREATE DATABASE roundcube;"
mysql -e "GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost IDENTIFIED BY
'DATABASEPASSWORD';"
mysql -e "FLUSH PRIVILEGES;"
mysql -e "use roundcube; source SQL/mysql.initial.sql;"

You will have to replace the roundcube password with ‘DATABASEPASSWORD’ field.

  • Configuring RoundCube
cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php

then open database configruation file  db.inc.php in your favroite editor like vi or pico or nano
vi db.inc.php
Find following line

$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

Replace it with

$rcmail_config['db_dsnw'] = 'mysql://roundcube:DATABASEPASSWORD@localhost/roundcube';

Now Open main.inc.php

vi main.inc.php

Find

$rcmail_config['default_host'] = '';

Replace with

$rcmail_config['default_host'] = 'localhost';

Last steps , restart the mysql, cpanel services on your server. That’s it ,Have fun with your new Roundcube installation!!

Regards

AlexP