Archive for February, 2013

Some times you might see there will be no /tmp file, instead it might be /tmps or /tmpz.

Then create /tmp folder and set 1777 permission.

Note: Here 1 is will set sticky bit.

Then set safemode off in main php.ini file.

You check the php.ini is located as #php -i |grep php.ini

To turn off magic_quotes and magic_quotes_gpc off in .htaccess, simply put these lines in the .htaccess file of your site / directory or in /home/public_html/ wherein you want magic_quotes or magic_quotes_gpc disabled:

php_value magic_quotes 0

php_flag magic_quotes off

php_value magic_quotes_gpc 0

php_flag magic_quotes_gpc off

FTP Failed to retrieve directory listing

Posted: February 6, 2013 in FTP

Some times we will get the error “ Failed to retrieve directory listing ” while trying to connect FTP .


Most of the time its because of the missing ftp kernel module ” ip_conntrack_ftp ”

1) Check if the ftp kernel module is exists

lsmod | grep ftp

2) Add the module

modprobe ip_conntrack_ftp

3 ) Restart ftp server

This will fix your issue !!

1. Go to /home/username/public_html

2. Vi .htaccess

php_value 4096
php_value suhosin.request.max_vars 4096
php_value suhosin.get.max_value_length 2000
php_value suhosin.request.max_varname_length 350

3. Exit and save

Note: Also you can verify the changes by creating a info.php file
Type the url as
Please find the screenshot pasted below.



Posted: February 3, 2013 in php

Clients wants to add below recommended settings as to run a software in the server:

1.You can get into /home/username/
2. vi php.ini
3. add below entries ( don’t add the bracket one which I mentioned below)

magic_quotes_gpc = Off
post_max_size = 60M (Maximum post size)
upload_max_filesize = 200M  (Maximum upload file size)
display_errors = Off   (Display Errors)
short_open_tag = off  ( Short Open Tag)
session.cookie_httponly = 1  (Cookie HTTP Only)



Posted: February 3, 2013 in php


$Subject=”Trying to send”;
$Message2=”Testing mail”;

if(mail($SendTo, $Subject, $Message2, “From: $Sender”)){
print”<br><br><FONT style=\”font-size:12px\” color=\”#009300\” face=\”Arial\”><B>Sent to: $SendTo  … Sender: $Sender</B></FONT>”;
print”<br><br><FONT style=\”font-size:12px\” color=\”#FF0000\” face=\”Arial\”><B>Not sent to: $SendTo  … Sender: $Sender</B></FONT>”;


Tips to remember:

Step 1:
Create a test.php inside public_html folder
For example —>  /home/public_html/test.php
Copy the above script and paste inside test.php  (remember to change the ownership of test.php)
run the url 
For example—> if you are creating test.php in your website
Run the url as
The mail will automatically send as php

Check mail service is up or not /etc/init.d/exim status
Check by send a test mail from test mail a/c, tail -f /var/log/main_log (For dynamic checking )
Check the Ip listed in RBL (Search the key word ‘spam database’ in Google)
Check by disabling the firewall , as it may be blocking the port 25
Check it by telnet to 25
Check the error by sending a test mail from the account,

if you are getting any error regarding   MX priority   check the domain is listed

/etc/localdomains (if the domain is using the server MX) or

/etc/remotedomains(if the domain is using remote server MX)