Magento商店不在localhost上工作

时间:2013-10-25 08:52:18

标签: php apache magento localhost

我正在尝试运行一个magento商店,该商店在我的localhost wamp服务器上的实时服务器上运行。我使用的Windows 7 x64包括:Apache 2.2.22,PHP 5.3.13和MySQL 5.5.24。 这是我尝试运行商店时得到的以下错误:

    Whoops, it looks like you have an invalid PHP version.
    Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.

        '; exit; } 
    /** * Error reporting */ 
    error_reporting( /*E_ALL | E_STRICT */ 0); 
    /** * Compilation includes configuration file */ 
    define('MAGENTO_ROOT', getcwd()); $compilerConfig = MAGENTO_ROOT . '/includes/config.php'; 
if (file_exists($compilerConfig)) { include $compilerConfig; } $mageFilename = MAGENTO_ROOT . '/app/Mage.php'; $maintenanceFile = 'maintenance.flag'; if (!file_exists($mageFilename)) { if (is_dir('downloader')) { header("Location: downloader"); } else { echo $mageFilename." was not found"; } exit; } if (file_exists($maintenanceFile)) { include_once dirname(__FILE__) . '/errors/503.php'; exit; } require_once $mageFilename; #Varien_Profiler::enable(); if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) { Mage::setIsDeveloperMode(true); } #ini_set('display_errors', 1); umask(0); 
    /* Store or website code */ 
    $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; 
    /* Run store or run website */ $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; Mage::run($mageRunCode, $mageRunType); 

在过去的一周里,我尝试并做了以下事情:

  1. 为php版安装了php_curl修复程序。 php_curl扩展程序有效,因为当我安装magento的新副本时,它可以正常工作。
  2. 我检查了安装Magento的所有系统要求列表,并且php扩展都正常工作。
  3. 我将php.ini中的memory_limit从128M更改为512M。
  4. 我将app / etc中的local.xml文件修改为指向我为本商店创建localy的localhost和db_name,db_user,db_pass。
  5. 我从本地数据库中的实时服务器导入数据库,并修改了core_config表中的base_url选项
  6. 我打开了apache模块headers_module,rewrite_module,include_module和php5_module。
  7. 我尝试将.htaccess编辑为rewrite_base,但没有任何改变。
  8. 我尝试从.htaccess注释掉了.htaccess AddType x-mapp-php5 .php和来自.htaccess的AddHandler x-mapp-php5 .php,但之后没有任何显示,所以我放弃了原样,没有注释。
  9. 我使用了4-5版本的php和apache ..但没有任何效果。
  10. 现在最后一件事..在我的apache错误日志中...我得到的最后一件事是以下行:

    [Fri Oct 25 11:50:14 2013] [warn] Cannot get media type from 'x-mapp-php5'

    请帮我解决这个问题。 提前感谢您的时间和帮助。

1 个答案:

答案 0 :(得分:0)

尝试在localhost上运行magento,如下所示:

检查您的设备IP并将以下行添加到windows / system32 / drivers / etchosts文件

192.168.1.59       magento.hue
192.168.1.59       www.magento.hue

请相应更改IP。

然后转到你的xamp-installation / apache / conf-extra / httpd-vhosts.conf

并添加以下

NameVirtualHost 192.168.1.59:80
<VirtualHost magento.hue>
    ServerAdmin magento.hue
    DocumentRoot "C:/www/mag_domain/"
    ServerName magento.hue
    ServerAlias www.magento.hue
    ErrorLog "C:/www/mag_domain/error.log"
    CustomLog "C:/www/mag_domain/access.log" combined
    <Directory "C:/www/mag_domain">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

假设C:/ www / mag_domain /是您下载实时网站的文件夹的路径。相应地改变。

将db导入到本地mysql并在app / etc / local.xml中更改用户名/密码等

然后尝试在浏览器上运行http://magento.hue并告知结果。

请尝试使用一堆新的magento网站和数据库,以防您更改了内容。