Monday, September 29, 2008

PHP with fastcgi (IIS 6)

This isn't MySQL related but since I also run PHP on some Windows 2003 servers (IIS 6) I thought I would make a post as I switched from isapi to fastcgi.

The process went fairly smooth following the good instructions at iis.net on my dev server. Here is the link to their article:
http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/

When I deployed to one of my production servers I was having issues with a specific application. I was getting this error:
FastCGI Error

The FastCGI Handler was unable to process the request.

Error Details:

* Error Number: 5 (0x80070005).
* Error Description: Access denied.

HTTP Error 500 - Server Error.
Internet Information Services (IIS)


All of my applications work on their own application pool. Since all the other applications were working properly I knew it was not permission issues to php-cgi.exe like others have posted about. My issue was application pool specific. The difference this application pool had vs the others was in the properties > performance for the pool. Enable CPU monitoring was checked. Once I unchecked this everything started working properly.

Issue solved. I just want to read up now on why this doesnt work and what other issues are related in iis 6

Thursday, September 25, 2008

Flushing the log-slow-queries log file

One of the things that I have seen a lot of questions on is how to "flush" the slow query log. I think most people expect when you perform a mysql>Flush Logs that it will create a new log file. This is true for the Binary logs but not the slow query and general logs.

The action that mysql takes when the mysql>Flush Logs command is given closes and then reopens the slow query and general logs.

To start a new log you will want to rename the current log file then perform a mysql>Flush Logs. MySQL will create a new log file with whatever you have set as the log-slow-queries= slow_queries
On windows you would roughly perform:
c:\>cd mysql-data-directory
d:\db\data>ren slow_queries slow-queries-old
d:\db\data>mysql -u user -pPassword
mysql>flush logs;
mysql>exit;
The same goes for the general log file. The only assumption made in this article is that you are actually already logging slow queries via your my.ini config option of log-slow-queries= slow_queries