Changing Time Zones via php.ini file in cpanel servers
You can change the parameter date.timezone to change it to appropriate time zone.
eg : -
date.timezone = "America/Denver";
Use the appropriate option at http://php.net/timezones
Changing wordpress theme to default theme via command line
Log in to mysql server and issue the command :
SELECT * FROM wp_options WHERE option_name = 'template' OR option_name = 'stylesheet' OR option_name = 'current_theme'; UPDATE wp_options SET option_value = 'twentyeleven' WHERE option_name = 'template' or option_name = 'stylesheet' or option_name = 'current_theme';
Pointing your home site's URL to a subdirectory in wordpress
In some cases, you may have a WordPress site that changes significantly every year, such as with a conference website. If you want to install each year's version of the site in a subdirectory, such as /2010, /2011, and /2012, but have the root domain (yoursite.com) automatically redirect to a particular subdirectory (usually the latest), follow this technique:
Install WordPress in a subdirectory, such as /2012.
In your root folder (not the subdirectory folder), download and open your .htaccess file.
Add the following to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ blog [L]
In the above code, change the "YourDomain.com" value to your root domain.
In the above code, change the "blog" value to the subdirectory.
Save and upload the .htacess file back to your root directory.
Now when users to go your root domain (yoursite.com), it will automatically redirect to the subdirectory you specified. When you want to redirect to a new subdirectory, such as the conference site for next year, just update the .htaccess redirect code.
Finding Document root of the domains in Cpanel servers
By checking the domlogs in the location /usr/local/apache/domlogs (cpanel servers) we can find the exact script which is used to send the spam. eg :-
grep POST /usr/local/apache/domlogs/domain.com(The domain in which the spam are sent)
Add/Remove Reseller Privileges in WHM
Home >> Resellers >> Reseller Center)
Using a set of pull-down menus and buttons, you are able to add or remove reseller status on existing accounts. It is important to keep in mind that you are not able to add a new account here. You must first create the account you wish to modify using the Create a New Account feature.
To add reseller privileges :
Select the appropriate account from the pull-down menu on the left.
Click the checkbox if you wish to allow the reseller to access his or her account via WHM. (You will be able to configure the user’s WHM options by clicking Edit Privileges/Nameservers below.)
Click the corresponding ok button.
To remove reseller privileges:
Select the appropriate account from the pull-down menu on the right.
Click the corresponding ok button.
Code to test PHP function mail()
In order to test PHP function mail() on your server, create a test PHP file (e.g., testmail.php) with the following contents:
<?php
$message = '';
if (isset($_POST['email']) && !empty($_POST['email'])){
if (mail($_POST['email'], $_POST['subject'], $_POST['body'], '')){
$message = "Email has been sent to <b>".$_POST['email']."</b>.<br>";
}else{
$message = "Failed sending message to <b>".$_POST['email']."</b>.<br>";
Upload the created file to a publicly accessible directory (e.g. public_html, www, htdocs or another depending on the server configuration).
Run the test file by typing its URL in the browser address bar, e.g. http://mydomain.com/testmail.php.
Enter an email address, a message subject and body in the text fields of the page that will appear and click on "send" to send a test email message.
In case of a successful dispatch of the email a message of kind "Email has been sent to …" will appear in the browser. Otherwise "Failed sending message to..." will appear.