Search code examples
magentoinstallationiis-6fastcgiphp-5.3

Magento installtion error C:\Program Files (x86)\PHP\v5.3/app/Mage.php was not found


I'm trying to install Magento on IIS6.1 on Windows Server 2008.

When I go to: http://www.mydomain.com/install.php I’m getting this error:

C:\Program Files (x86)\PHP\v5.3/app/Mage.php was not found

I’ve done a day of Google searches and arrived on posts like: http://www.magentocommerce.com/boards/viewthread/15003/ http://www.magentocommerce.com/boards/viewthread/79826/ http://www.imagedia.com/2010/09/appmage-php-was-not-found-using-magento/

There’s something about disabling PHP safe mode and altering index.php, but they all run on Plesk or at least not IIS.

I have this Handler Mapping in IIS:

Request path: *.php
Module: FastCgiModule
Executable (optional): C:\Program Files (x86)\PHP\v5.3\php-cgi.exe
Name: PHP53_via_FastCGI
Restrictions
Mapping: Invoke handler only if request is mapped to: File or Folder
Verbs: On of the following verbs: GET,HEAD,POST
Access: Script

which should be correct according to this blog: http://www.gentex.com.au/info-center/blog/gentexs-web-blog/installing-magneto-on-iis7-ndashwindows-7-and-2008-server

How to fix this error on IIS?

Thanks!!

Locally on my Windows 7 machine with IIS7.5 the installation does work.

Also: I plan to use multiple stores on my Magento installation, don’t know if that requires a different solution.


Solution

  • I solved it. I changed this line in index.php:

    define('MAGENTO_ROOT', getcwd());
    

    to

    define('MAGENTO_ROOT', __DIR__);
    

    the DIR function gets the current working directory of the script.

    I can now install Magento and view the frontend of my site, but I'm now running into login issues. This may be caused by the fact that my sessions are saved on disk and again the right folder is not found or that I have not set the right folder permissions yet (not even sure if that's feasible when I was able to install Magento in the first place). It appears I'm one step further now though.