In this article I’ll give some real live examples of using these ported GnuWin tools like grep.exe
for logfile analysis on Windows servers. The article provides three examples as an alternative to Microsoft’s Log Parser tool, because finding spam scripts fast is often very important.
Connect to MS SQL Server with PHP 5.3+
Connect to a Microsoft SQL Server database with PHP 5.3+ using the SQLSRV API and sqlsrv_connect
. As of PHP 5.3.2 you have to use the SQLSRV API functions to connect to an Microsoft SQL Server database from PHP. For example, use sqlsrv_connect()
to create a connection resource and open a connection. The main difference with the older mssql functions of PHP is that SQLSRV requires an Array() with connection information, instead of strings.
Unauthorized Access: Bypassing PHP strcmp()
Unauthorized Access: Bypassing PHP strcmp(). A way to bypass PHP’s strcmp() binary safe string comparison function.
MySQL Connector/NET and Entity Framework
How to let MySQL Connector/NET and Entity Framework play nicely. This blog post is a quicky and an oldy… Since we still receive a reasonable amount of questions about this topic at the customer service of my employer I’m posting this here, with some commonly made mistakes and points of attention.
WordPress 3.5 on IIS 8.0 is unable to save a web.config file
This website Saotn.org is hosted on Windows Server 2012 with IIS 8.0 with WordPress for a few months now, and everything is running very smooth. And I would never hit this bug because I don’t need to change my permalinks structure, or save any other plugin setting which would want write to a web.config file. One of my colleagues on the other hand, just moved his website to one of our IIS 8.0 web servers and he noticed he couldn’t save his Permalinks structure in the IIS web.config file. This can be pretty annoying ;-) Quick fix attached…
Create your own PHP based Origin Pull CDN
The advantage of having your website content hosted on a Content Delivery Network (CDN) is having your content distributed and stored across the Globe. Utilizing the network of the Content Delivery Network provider. Hosting your WordPress website on a Content Delivery Network is an important WordPress optimization tip. Here is how to create your own Origin Pull CDN with just a few lines of PHP…
Cache MySQL query results with PHP WinCache
In November 2011, I wrote a post about MySQL query caching with PHP/Zend_Cache, and I recently stumbled upon a blog post caching MySQL query results in memcached by “KutuKupret”. This made me wonder if the same would be easily done with the Windows Cache Extension for PHP.
Calculate MySQL database size with PHP (off the old shelf)
Calculate the MySQL database size in PHP. Sometimes you’d be amazed what you find when cleaning out your old script archives. I found an old PHP script to calculate the size of a MySQL database. I post it here just for the fun of it.
Convert .htaccess to web.config
This post describes some of the IIS URL Rewrite Module web.config equivalents of commonly used Apache .htaccess settings. This is useful when you convert your Apache .htaccess to IIS web.config. The second part of this post outlines how to use Internet Information Services Manager to import and convert .htaccess rules to web.config automatically.
PHP with WinCache on IIS
In this article you’ll learn how to install PHP on Windows Server IIS. With the Windows Cache Extension for PHP (WinCache). WinCache enabled PHP gives you great performance for WordPress, Drupal and Joomla websites, and decreases CPU usage. In this post I’ll show you it’s not hard to set up a high performing PHP stack on Windows Server (IIS). So, let’s optimize our PHP hosting on Windows Server!
Remove ETags HTTP response header in IIS
Yahoo! YSlow recommends removing Entity tags – also known as “ETag”. Unfortunately removing the ETag response header is not an easy task on Windows Server IIS web servers. Here I show you how to properly remove ETag HTTP response headers with an IIS Rewrite Module Outbound rewrite rule…
"The length of the URL for this request exceeds the configured maxUrlLength value"
The length of the URL for this request exceeds the configured maxUrlLength value
is an IIS error telling you the length of the given URL exceeds a limit. The Windows Server IIS maximum URL length is defined by the HttpRuntimeSection.MaxUrlLength
property. Its value is 260 characters. This may cause problems with longer than configured maxUrlLength
URL’s, and here is how to resolve this issue…
“htaccess files should not be used for security restrictions”
Acunetix’ Bogdan Calin wrote an article explaining why .htaccess files should not be used to secure sensitive data: htaccess files should not be used for security restrictions.
WordPress HyperDB is an advanced database class that supports replication
HyperDB database class. HyperDB: an advanced database class for WordPress, that supports replication and partition of data. HyperDB is a replacement for the standard wpdb class, which adds the ability to use multiple databases. HyperDB supports partition of data as well as replication.