Enabling apc (php alternative cache) on your Centos VPS

Here is how to enabled php’s apc on a CentOS VPS:

1. yum -y install php-pear pcre-devel php-pear php-devel httpd-devel gcc
2. pecl install apc (press enter to accept the default response for each option)
3. echo “extension=apc.so” > /etc/php.d/apc.ini
4. service httpd restart
5. cp /usr/share/pear/apc.php /home/YOUR_USER_NAME/www/some_private_file_name.php

The apc.php page can be loaded to view the cache status. We recommend you rename it to something other than apc.php

Setting up yum for end-of-life CentOS 4 VPS

CentOS 4 is no longer supported by the developers and we do not recommend you install it. If you have a special case which requires CentOS 4, you will find that yum will not update or perform installs because the repository URL’s are no longer valid.

To make yum work with vault.centos.org, edit your :


to have these lines:

name=CentOS-$releasever - Base

#released updates
name=CentOS-$releasever - Updates

yum update, yum install, etc. will now work.

I’ve lost my email password. How can I reset it?

[ Note : These are the complete step-by-step instructions. In many cases, your email password is the same as your control panel password. You may wish to try that password first.]

Here is the best method to reset an email password.

1. Login to your hosting control panel at:


2. If you know your “postmaster” (master) password, skip to step 3. If you do not know your “postmaster” (master) password, click on :

“Password: change”

in the side left section of your control panel.

Here you can change your password. The new password will affect your hosting control panel, ftp and master email password.

3. After you have your master email password, click the “email” link near the top of the control panel.

4. Click “Configure your email accounts”

5. Login here with :

POP Account: postmaster
password: your postmaster password set in step #2
domain: your-domain.com

6. Click :

Edit existing address:

7. Click the red circle under “Modify User” for the user you wish to change the password for.

Send mail using Pear:Mail

How can I send mail from php using a specific smtp host, for example, smtp1.phpwebhosting.com or my private smtp server?

Use the pear mail package.


$from = ““;
$to = ““;
$subject = “Test”;
$body = “Test”;

$host = “smtp1.phpwebhosting.com”; // enter the smtp server you wish to use here
$port = “25”; // smtp port
$username = “your_smtp_user@domain.com”; // your smtp-auth username
$password = “your_password”; // your smtp-auth password

$headers = array (‘From’ => $from,
‘To’ => $to,
‘Subject’ => $subject);
$smtp = Mail::factory(‘smtp’,
array (‘host’ => $host,
‘port’ => $port,
‘auth’ => true,
‘username’ => $username,
‘password’ => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {

” . $mail->getMessage() . “

} else {

Message successfully sent!


ssh will not connect – Connection closed by remote host


When I try to connect with ssh I get an error such as “ssh_exchange_identification: Connection closed by remote host”. I know that ssh is enabled on my account. What is wrong?


Usually these errors are caused when an attacker is scanning for badly configured servers with default usernames and passwords or easy to guess passwords. Our scripts detect and block such scans/attacks but there can be times during the attack when all connections are taken and the server refuses new connections. Your server is safe and such attacks/scans are part of the day-to-day life of servers on the internet. Usually you never notice the effects but in rare cases there can be disruptions.

A temporary work-around is to connect to ssh on port 23. Many of our servers run ssh on port 23 as well as port 22. You can try to connect to port 23 with:

ssh your_username@your_server.com -p 23

or change the port from 22 to 23 in your client.

Hide eregi() deprecated errors


My script gives errors like:

Deprecated: Function eregi() is deprecated in /home/my_username/www/path/contact/include/fgcontactform.php on line 548

Why is this occuring? How can I fix it?


Newer php versions are removing support for the eregi() function. Your script will continue to work but using normal php.ini settings the deprecated errors are shown. You can hide the errors by adding:

error_reporting = E_ALL & ~E_DEPRECATED

to your /home/username/etc/php.ini file

Create the file if it does not exist. If you already have a error_reporting line, modify it hide E_DEPRECATED

If you are on a VPS, edit /etc/php.ini and restart httpd if you are running mod_php.

You should also work to update your script to no longer call the deprecated functions as future versions of php will remove support for the functions completely.

How to disable mod_security on shared hosting via .htaccess

Question: I’m installing a new php cart and get the error :

Your webserver has the mod_security module enabled. As a result, you may see the “403 Forbidden” or “Not Acceptable” error messages after submitting forms that contain “curl”, “perl”, “set”, etc. It is recommended to disable this module or reconfigure it so that these words are not forbidden.*

How can I disable mod_security?


To disable mod_security, add the following to a .htaccess file in the base directory for the script you are trying to install.

SecFilterEngine Off
SecFilterScanPOST Off

Outgoing mail is no longer working (error 0x8004210B)


I get the error :

Task ‘xxxx@xxxxxxxxxxxxxx.com – Sending’ reported error (0x8004210B): ‘the
operation timed out waiting for a response from the sending (SMTP) server.
If you continue to receive this message, contact your server administrator or
Internet service provider (ISP).’

when trying to send mail. How can I fix this?


Your local ISP may have begun blocking port 25. Many ISP’s do this to attempt to make you only send through their SMTP servers so they can better manage all mail leaving their network (to control spam). Change the port to 2525 in your email program and it will likely work. If 2525 does not work, try port 587.

Another – less likely cause – is hung anti-virus software running on your computer. Some anti-virus / anti-malware software re-directs all port 25 activity to scan mail before it leaves your computer. Try to restart your computer and/or anti-virus software and see if this corrects the problem.