Tag Archive for 'Tips'

How to show error description in Magento 1.4

Simply go to your magento installation folder, locate the errors folder and you will find local.xml.sample, simply duplicate the file and rename it local.xml

Godaddy Full Website Backup on a Shared Hosting Account

I had been grappling with this problem since there is no straight forward backup website button in the godaddy’s control panel. PHP scripts seem to run into script timeouts or http timeouts because of the mammoth size of the website.

Heres the solution with help and information from:
http://www.bala-krishna.com/permission-denied-error-with-godaddy-cron-job

Bala Krishna has an excellent writeup on how to use the cron job on godaddy and to avoid the permissions error.

  1. Hence create a shell script file called sitebackup.sh
  2. Copy and paste the following:
    /bin/sh tar -cvvf /$HOME/html/fullsite.tgz .
  3. Save it.
  4. Upload to godaddy.
  5. Go into the control panel and locate the Cron Manager.
  6. Add a new Cron Job and Browse for the script you uploaded.

The backup should be created in the root of your web folder accessible via FTP or the web.

EMS SQL Manager Lite

I had been working with this wonderful piece of software and had no problems with it until today when I realise that the software maintains a consistent connection to MySQL server until you hit the commit transactions button. This means any queries from somewhere else like PHP will get hung up and timeout, so if you are wondering why things are not moving, do check this piece out.

Installing PHP5 on IIS7 in Windows Vista

Server Crash
For the past week or so, the server hosting the blog crashed bad and had to be sent in for repairs and the recovery process was a very tedious one. Kudos to the people over at 8toinfinity for working throughout the week to bring the server back into shape. The fortunate thing was that we didn’t lose data thanks to RAID mirroring and everything was more or less preserved.

Setting up PHP5 on IIS7 in Vista – My journey of exploration and discoveries
In the meantime I had attempted to set up PHP on IIS7 on my local machine to do some testing and ran into some issues with the latest version of PHP 5.25 Win32 installer while setting it up with IIS7 on Windows Vista. Apparently after using the installer, IIS7 on Windows Vista actually does not get modified properly to support PHP out of the box. A bit of disappointment there but I proceeded to remove PHP5 via the uninstaller and downloaded the zip package to do manual set up. That was where the problems set in. I kept getting an error where my IIS Worker Process kept crashing resulting in the Default App Pool to get shut off after repeated failures to launch a dll or exe. (Take note that im setting up FastCGI for PHP on IIS7).

Somehow after removal of PHP5 via the uninstaller and using the zipped version, PHP was still trying to use the php5isapi module although I had removed it from IIS completely (or so i thought). Here is the error you might see although php5isapi had been seemingly removed: (IMPORTANT: The following are NOT steps to be followed for a clean installation of PHP on IIS7)

Here is what you need to check:

Start >Run > “cmd” (Bring up your command prompt on Vista)

Navigate to your <Windows Directory>\System32\inetsrv folder (e.g. C:\windows\system32\inetsrv)

Then execute the following command: “appcmd list config -section:globalmodules

You should see an XML list being shown that shows the installed modules in your IIS.

Look for this:

<add name=”php5isapi” image=”C:\php\php5isapi.dll” />

If it exists, it means php5 was NOT uninstalled properly. So we need to remove this entry before FastCGI will work.

Use the following commands:
C:\Windows\System32\inetsrv>appcmd set config -section:globalmodules /-[name='php5isapi']

If successful, you will get the following message:
Applied configuration changes to section “system.webServer/globalModules” for “MACHINE/WEBROOT/APPHOST” at configuration commit path “MACHINE/WEBROOT/APPHOST”

Try listing the modules again and the php5isapi node should be removed.
C:\Windows\System32\inetsrv>appcmd list config -section:globalmodules

With all these done, you can then proceed to set up FastCGI for PHP on IIS7 by

Running: fcgisetup.exe /install /add c:\php\php-cgi.exe php

from the directory on which you downloaded the FastCGI package.

This should set up PHP FastCGI on IIS7 automatically.

If your app pool was stopped (e.g. defaultAppPool), simply restart it in IIS7 and try to load the php page again. It should work.

You should see the following handler mappings in IIS7:

You should see that php-iisfgi is in the list, this means the PHP FastCGI module for  IIS7 is installed properly.

Lastly, just a few quick notes (this is nothing related to the above, but just a reminder just in case you were as silly as I were):

  1. For those who are unable to locate your php.ini and are about to bang your head (or have already banged your head on the desk)
    You have to add the path to your php.ini in an environmental variable called PHPRC not in the TEMP variable
  2. ISAPI and CGI support modules are not installed by default when you install IIS by just checking IIS in the program and features.
    Go back to Program and Features > Click on Turn Windows features on or off on the left sidebar and follow the following diagram making sure that ISAPI and CGI support is on. ( You can choose either depending on what PHP executable you are using )

Yep thats all I have for this post, hope this helps for  people trying to set up PHP5 using FastCGI on IIS7 :)

Cheers!