Connect Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 14 July 2013

How to schedule a PHP script in task scheduler

Posted on 22:35 by Unknown
Quiet often there is a need to execute/run php script on some time interval at server side. And that php scripts should run automatically on windows server. You can add a task in windows task scheduler to run PHP script. 

PHP script can be executed easily on command prompt using the below command:
ex. C:\Path\to\php.exe -f "C:\Path\to\file.php"    
where -f is file attribute - parse and execute file.


Follow the below given steps to configure the PHP script to run in task scheduler.

1. To open task scheduler, click on Start >> Administrative Tools >> Task Scheduler.

2.Click on "create task" from "Actions" menu bar on right pane.




















3. In General tab, enter the name of the task.

4. In triggers tab, click on New and schedule the time at which script should execute, as per your requirements.




5.In Action tab, click on new and select 'Start a program' from Action option.Enter the path of PHP.exe in program/script field. Now enter the file option ex: -f c:\pathToHtdocs\fileName.php in Add Arguments field and click on Ok.



6. In condition tab, it is recommended all the option to default.




7. In settings tab, you can configure the options as per your requirements.


8. You are done with scheduling the PHP script, now you can select 'Run' option from options menu, to execute the task.

Read More
Posted in | No comments

Tuesday, 14 May 2013

Reset Mysql root Password using my.ini

Posted on 04:31 by Unknown

Follow the below given steps to reset the Mysql root password :

1.Browse to your MySQL installation directory.

2. In there, go to "Data" directory. 

3. Find and Open the file named "my.ini"

4. Please ensure that you take a backup of the file "my.ini" prior making any changes. Between the 1st line "[MySQLD]" and 2nd "PORT=" enter "skip-grant-tables"

5. Restart MySQL Service.

You should now be able to login to MySQL prompt without Password.

Once you are at MySQL Prompt,its time to reset the existing password.

Type in
"UPDATE mysql.user SET Password=PASSWORD('New_password') WHERE User='root';"

This will give something like "Query OK, 0 rows affected (0.04 sec)
Rows matched: 1 Changed: 0 Warnings: 0"

7. Type "FLUSH PRIVILEGES;" and hit enter.

You have just reset your MySQL root password.

Now,Do not Forget to undo the changes made in "my.ini" file.

8. Remove "skip-grant-tables" from "my.ini" and restart MySQL Service.

Now you are ready to use your MySQL Service with New Password.


Read More
Posted in | No comments

Remove logs or Entries from the Remote Desktop Connection

Posted on 04:22 by Unknown

I found that most people have no idea how to delete a cached entries from Remote Desktop Connection (RDC) on a Windows OS based computer. In fact, I had no clue how to do this. Even after you log out and select delete profile from the RDC, it will still show up in the Connections drop down next time someone open it. This is a problem because if a user with wrong intent to attack your computer or server open the RDC, it will provide them with half of the solution to hack your system, the IP or domain name!
 I have no idea why a great user friendly software company like Microsoft doesn't explain well on their help sites on registry editing for intermediate to advance users. May be because they don’t want novice users to pick up that information from their site and damage the OS in the process of regedit. Yes, it include the path and how to edit it, but there are no clear cut step by step instructions on how to properly do it.
The following method is the easiest way to delete an entry from Remote Desktop Connection:
-Open regedit: Type regedit on the general search (on the start menu) of the computers running Windows Vista and up. If you have a older OS, then open Run, and type regedit.exe.
-Find this parth: Go in to the Terminal Server Client using, HKEY_CURRENT_USER–>Software–>Microsoft–>Terminal Server Client–>Default
-Delete the entry: You will see all the entries with their respective IP address or domain names recorded on the system history. Pick the one you want to delete and hit delete on your keyboard OR right click and delete it.
Make sure you close the regedit.exe BEFORE you open the RDC because this change may not reflect on the client.
Now you will not see the entry in the RDC client when you open it the next time.

Read More
Posted in | No comments

Saturday, 27 April 2013

Cannot Set SmarterMail as Default MailServer in Plesk

Posted on 01:00 by Unknown
Some times when you try to integrate latest versions SmarterMail in your plesk. You will get the error :

Error: Set default component failed: defpackagemng failed: Loaded Postoffice Configuration Provider (MEAIPO.DLL)
Unable to assign port to IP address.
Reason:
Unknown IP Address: 169.254.16.152


Kindly follow the below given steps to solve this issue :

1. Go to Regedit.

2. Go to the path : 
     Local_Machhine >> Software >> Wow6432Node >> Plesk >> Psa config >> config 

3.  Locate the record MAIL_PROVIDERW_DLL 
and change it to :
C:\Program Files (x86)\Parallels\Plesk\admin\bin\smartermailprovider.dll

4. Next, locate the path : 

Local_Machhine >> Software >> Wow6432Node >> Plesk >> Psa config >> config >> Packages >> Mailserver and set Default regisrty entry to smartermail

5. Save the registry. No need to reboot.

6. Open Plesk using admin login, go to  Tool and setting >> Server components >> and click on refresh.

Now you will see SmarterMail as default mail server in plesk server components :)
Enjoy!!!
Read More
Posted in | No comments

Wednesday, 24 April 2013

HOW TO: FIX ERROR - The microsoft.ace.oledb.12.0 provider is not registered on the local machine

Posted on 00:43 by Unknown

Basically, if you're on a 64-bit machine, IIS 7 is not (by default) serving 32-bit apps, which the database engine operates on. So here is exactly what you do:

1) ensure that the 2007 database engine is installed, this can be downloaded at: http://www.microsoft.com/en-us/download/details.aspx?id=23734

2) open IIS7 manager, and open the Application Pools area. On the right sidebar, you will see an option that says "Set application pool defaults". Click it, and a window will pop up with the options.

3) the second field down, which says 'Enable 32-bit applications' is probably set to FALSE by default. Simply click where it says 'false' to change it to 'true'.

4) Restart your app pool (you can do this by hitting RECYCLE instead of STOP then START, which will also work).

5) Done, and your error message will go away.
Read More
Posted in | No comments

Thursday, 4 April 2013

How to configure IIS 7 to redirect non-www domain to www domain?

Posted on 04:11 by Unknown
One of few legacy leftovers that was never dropped over the years is the common use of www domain prefix. It is not a problem per se for us humans, but SE bots have mind of their own. When traversing a non-www and a www version of a web site, apparently, google and other bots are treating them as two separate web entities, even if content is identical.

This causes confusion in SE databases and in a worst case a drop from the index.
To avoid this confusion, web site operators should redirect their non-www traffic to www version of the website, or redirect the www version to the non-www version of the site.

This should be done using 301 redirect, i.e. when request for http://example.com is made, the web server would return

HTTP/1.1 301 Moved Permanently
Location: http://www.example.com/


response with the location of the new site.


So how can I do this in IIS 7? Well, you have to edit web.config file, modify or add
the following section to its rewrite section.


<rewrite>
<rules>
<rule name="non www to www" enabled="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" />
</conditions>
<action type="Redirect" url="<a href="http://www.{HTTP_HOST}/{R:0"
>http://www.{HTTP_HOST}/{R:0</a>}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
 
This should be your first rule.

The rewite section should be placed in system.webServer section.

Then just refresh your site and voila you have all trafic to http://example.com/* redirected to http://www.example.com/*
Read More
Posted in | No comments

Wednesday, 3 April 2013

How to Fix the Error Establishing a Database Connection in WordPress

Posted on 08:57 by Unknown
In this article, we will show you how to fix the error establishing a database connection in WordPress by compiling a list of solutions all in one place.

Note: Before you make any database changes, make sure you have sufficient backups.  

You are getting this error because WordPress is unable to establish a database connection. Now the reason why WordPress is unable to establish a database connection can vary. It could be that your database login credentials are wrong or have been changed. It could be that your database server is unresponsive. It could be that your database has been corrupted. In my experience, majority of the times this error happens because of some sort of server error however there could be other factors as well. Lets take a look at how to go about troubleshooting this problem. 

First thing you should do is to make sure that you are getting the same error on both the front-end of the site, and the back-end of the site (wp-admin). If the error message is the same on both pages “Error establishing a database connection”, then proceed onto the next step. If you are getting a different error on the wp-admin for instance something like “One or more database tables are unavailable. The database may need to be repaired”, then you need to repair your database. 

You can do this by adding the following line in your wp-config.php file:


define('WP_ALLOW_REPAIR', true);

Once you have done that, you can see the settings by visiting this page:

http://www.yoursite.com/wp-admin/maint/repair.php

 
 
Remember, the user does not need to be logged in to access this functionality when this define is set. This is because its main intent is to repair a corrupted database, Users can often not login when the database is corrupt. So once you are done repairing and optimizing your database, make sure to remove this from your wp-config.php.
If this repair did not fix the problem, or you are having trouble running the repair then continue reading this article as you might find another solution to work.

Checking the WP-Config file

 

 wp-config.php is probably the single most important file in your entire WordPress installation. This is where you specify the details for WordPress to connect your database. If you changed your root password, or the database user password, then you will need to change this file as well. First thing you should always check is if everything in your wp-config.php file is the same.

  define('DB_NAME', 'database-name');


define('DB_USER', 'database-username');

define('DB_PASSWORD', 'database-password');

define('DB_HOST', 'localhost');
 Remember your DB_Host value might not always be localhost. Depending on the host, it will be different.

If everything in this file is correct (make sure you check for typos), then it is fair to say that there is something wrong on the server end. 


Check your Web Host (MySQL Server)

 

Often you will notice this Error establishing database connection when your site gets swarmed with a lot of traffic. Basically, your host server just cannot handle the load (specially when you are on shared hosting). Your site will get really slow and for some users even output the error. So the best thing you should do is get on the phone or livechat with your hosting provider and ask them if your MySQL server is responsive. 

For those users who want to test if MySQL server is running yourself, you can do a few things. Test other sites on the same server to see if they are having the issue. If they are also getting the same error, then most definitely there is something wrong with your MySQL server. If you do not have any other site on this same hosting account simply go to your cPanel and try to access phpMyAdmin and connect the database. If you can connect, then we need to verify if your database user has sufficient permission. Create a new file called testconnection.php and paste the following code in it:

 <?php

$link = mysql_connect('localhost', 'root', 'password');

if (!$link) {

die('Could not connect: ' . mysql_error());

}

echo 'Connected successfully';

mysql_close($link);

?>

Make sure to replace the username and password. If the connected successfully, then it means that your user has sufficient permission, and there is something else that is wrong. Go back to your wp-config file to make sure that everything there is correct (re-scan for typos).
If you cannot connect to the database by going to phpMyAdmin, then you know it is something with your server. It does not necessarily means that your MySQL server is down. It could mean that your user does not have sufficient permission. 

In one scenario, MySQL server was running. All other sites on the servers were working fine except for wordpress website. When we tried going to our phpMyAdmin, we ended up getting the error: 

#1045 – Access denied for user ‘foo’@'%’ (using password: YES)

if you get this access denied error in either connecting to your phpMyAdmin or through testconnection.php results, then you should contact your host right away to get them to fix it or just try to delete the mysql database username and recreate it.
Read More
Posted in | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • How to schedule a PHP script in task scheduler
    Quiet often there is a need to execute/run  php  script on some time interval at server side. And that php scripts should run automatically ...
  • HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to run CGI applications.
    If you get the error “HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to...
  • Roles and Features showing an error HRESULT: 0x800F0818 in Server Manager of windows server 2008 R2
    When you open Server Manager both Roles and Features display Error and you are unable to add any role or features. When you select the det...
  • Error - "Failed to retrieve data for this request (Microsoft.SqlServer.Management.sdk.sfc)"
    ErrError    - In Microsoft SQL Management Studio 2008, you receive the following error message when you try to expand the Databases:      ...
  • How to configure IIS 7 to redirect non-www domain to www domain?
    One of few legacy leftovers that was never dropped over the years is the common use of www domain prefix. It is not a problem per se for us...
  • Back up all MS SQL databases at once
    This article will discuss how to backup all MS SQL databases with one script. A separate file will be created for each database. Log into ...
  • The media family on device is incorrectly formed. SQL Server cannot process this media family Error: 3241
    When you try to restore a backup of the database you get the following error: The media family on device ” is incorrectly formed. SQL Server...
  • How to check Malware injection in Code
    To check Malware injection in your script/Code you can use a Web based Google Tool called “Webmasters Tools” You can find it here Google We...
  • Stopping Unneeded Services In Windows Server 2008
    By  default Windows 2008 starts with a number of services that actually do not need to be running. Many of these services can impact perfo...
  • 503 This mail server requires authentication when attempting to send to a non-local e-mail address
    If you are facing the following error in receiving the emails for Plesk Webmail on Windows server: We recommend contacting the other email ...

Categories

  • booting Process
  • linux
  • redhat

Blog Archive

  • ▼  2013 (68)
    • ▼  July (1)
      • How to schedule a PHP script in task scheduler
    • ►  May (2)
    • ►  April (11)
    • ►  March (54)
  • ►  2012 (44)
    • ►  September (20)
    • ►  August (1)
    • ►  July (4)
    • ►  June (12)
    • ►  May (2)
    • ►  March (4)
    • ►  February (1)
  • ►  2011 (1)
    • ►  February (1)
  • ►  2009 (9)
    • ►  September (3)
    • ►  August (2)
    • ►  June (1)
    • ►  May (2)
    • ►  March (1)
Powered by Blogger.

About Me

Unknown
View my complete profile