Posts Tagged ‘PHP’

MobilePress caused 55,000+ files in c:\windows\temp

March 19th, 2009

A while after installing the MobilePress 1.0.3 plugin for WordPress, my IIS server locked up.  I rebooted it and all was well.  A while later, it locked up again.  Upon further investigation, I found 55,000+ files in the c:\windows\temp\ folder and new files were popping in there at a rate of a few per minute.

Each of the 55,000 files looked like:

sess_1dq5436rb4m9b399cojhnmitd1

sess_3meinb58v9oqra5ia0869pqig6

sess_5hbicsnrt0hn1qj9lc5q9n7g30

where the prefix of sess_ is common but the rest is random.

Using Sysinternals procmon.exe, I was able to identify right away that the process responsible for creating the files was w3wp.exe which pointed me to IIS.  However, I wasn’t sure why IIS would begin doing this after being stable for a long time.

Searches on the internet said the files were being generated by PHP and indicated new user sessions as visitors hit my blog.  That helped confirm the fact that these were coming from IIS and the blog but still no tell tale reason as to why all of the sudden.

Then I opened up one of the files and it showed:
SESS_MOBILE_BROWSER|s:6:”mobile”;SESS_MOBILE_ACTIVE|b:0;SESS_MOBILE_THEME|s:7:”default”;

That was enough to jog my memory that I had recently installed the MobilePress plugin.

Removing the plugin immediately resolved the issues and the temp files are no longer created.

My First Blog and How To Install WordPress

October 18th, 2008

Well how special am I?  I had two paragraphs of my first blog post written and after changing to full screen mode, I lost everything I had typed!  And I was just about to comment how impressed I am with WordPress.  I still am but I just learned my first valuable lesson with this web based application.  I am actually blown away by the flexibility and number of versatile configuration screens the admin console has.  I am proof that with WordPress, anyone can have a professional looking blog, irregardless of content.  Now I just need to find a decent theme so my blog isn’t mistaken for RTFM Education.

So actually this isn’t quite my first ever blog post.  My first blog post was written several months ago on a different platform when I had five minutes to kill.  I also write family news once in a while on my boche.net site to keep our relatives up to date on current events around our house.

Before installing WordPress, I had a few thoughts on what my first blog post should be.  Helpful and insightful to the reader.  As I struggled for a few hours getting WordPress to work, I knew I had a topic in the making:  How To Install WordPress.  Well, not so much how to install and configure WordPress, but rather how to install and configure the prerequisite platform components so that WordPress works correctly.  Hopefully someone is able to follow the steps I did without wasting hours troubleshooting PHP, IIS, and directory permissions.  By the way, this is on Windows Server 2003.  The error message I was struggling when trying to use WordPress was “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”.  Here are the steps I followed to get WordPress up and running successfully:

  1. You need a web server.  Install Windows Server 2003 and Internet Information Services 6 (IIS).  Windows Server 2008 and IIS 7 may work also, but that platform introduces some significant differences which I don’t have the tested steps for.  Create your new website in IIS Manager, or use the default website.
  2. Install MySQL 5.0.67.  I used the MSI installer (file name is mysql-essential-5.0.67-win32.msi).  Don’t use the .zip file.  Choose an installation drive letter that’s going to provide enough disk space for your WordPress database and any other MySQL databases you might want down the road.
  3. Create your WordPress database by using the MySQL Command Line Client from the Start Menu.  The command is CREATE DATABASE wordpress;   Don’t forget the trailing semi-colon.
  4. Install the MySQL Administrator which you can download from the MySQL website.  File name is mysql-gui-tools-5.0-r13-win32.msi.  Use MySQL Administrator to create a WordPress user account that will be used by WordPress to manage the WordPress database in MySQL.  When creating the user account, grant all MySQL roles for the user on the WordPress database.
  5. Install PHP 5.2.6 using the MSI installer (not the .zip file).  File name is php-5.2.6-win32-installer.msi.�
    1. Perform a custom install. 
    2. Web Server Setup:  IIS ISAPI module
    3. Important:  Choose two extensions to install:  MySQL and MySQLi
  6. The installer will perform several key configurations for you:
    1. Adds your PHP installation directory to your PATH statement allowing your server to find the file libmysql.dll
    2. Places the two extension .DLLs in the \ext\ directory which PHP based WordPress needs
    3. Modifies the php.ini file to activate the two extension .DLLs
    4. Creates a PHP Web Service Extension in IIS and sets to Allow
    5. Adds the .PHP application extension and appropriate verbs to IIS
    6. Creates the environment variable PHPRC=(path to your PHP directory)
  7. Next step, set the correct NTFS permissions on your PHP directory.  Allow subfolders and files to inherit.
    1. Internet Guest Account (IUSR_servername) = Read & Execute
    2. NETWORK SERVICE = Read & Execute
  8. Install WordPress 2.6.2 by unzipping the folder contents into the appropriate IIS directory structure for the website defined in step 1 above.
  9. Set the correct NTFS permissions on your WordPress installation directory.  Allow subfolders and files to inherit.
    1. Internet Guest Account (IUSR_servername) = Modify
    2. NETWORK SERVICE = Modify
  10. In IIS Manager, modify the properties of your website.  Documents tab.  Enable default content page:  Add:  index.php
  11. Restart the World Wide Web Publishing service
  12. You’re ready to install and configure WordPress.  Follow the instructions at http://codex.wordpress.org/Installing_WordPress

Using the PHP MSI installer with the appropriate options is the best use of your time.  Many Google internet searches on the error message above will have you performing steps that may or may not resolve your issues if you choose to install PHP manually.  None of the home brew solutions worked for me and resulted in a waste of time:

  1. Modifying the php.ini, changing the path for extension_dir=
  2. Modifying the php.ini, tweaking values for extension=
  3. Copying the file libmysql.dll to %systemroot%\system32\
  4. Adding and modifying environment variables
  5. Rebooting your web server

Special thanks to Michael Sharman and his website who ultimately pointed me in the direction of re-looking at the PHP MSI installer where I had missed the steps of adding the two MySQL extensions.

By the way, after struggling for a while on my production web server and not wanting to muck it up while spinning my wheels, I called on the assistance of a vanilla VMware virtual machine running Windows Server 2003 to successfully test my new installation steps (taking snapshots along the way).  VMware virtualization helps save the day (again).