我试图在本地机器上设置我们的旧OSCommerce站点。我跟着these instructions,但当我尝试在本地打开网站时遇到了一些错误。将OSCommerce移动到本地服务器
我使用的是osCommerce 2.2-MS2。我的本地PHP版本是5.5.9,安装OSC的远程服务器是PHP 5.3.2版本。
当我去http://dev.osc.local/我得到下面的错误。 解析错误(!):语法错误,在/var/www/osc/index.php意外的文件结尾上线690 690线是index.php文件的最后一行是:
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
当我去http://dev.osc.local/admin我得到 致命错误:register_globals在php.ini中被禁用,请启用它!
我已经尝试将.htaccess文件添加到根文件夹和管理文件夹,但它没有奏效。 的.htaccess
# $Id: .htaccess 1739 2007-12-20 00:52:16Z hpdl $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
# AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
#<IfModule mod_setenvif.c>
# <IfDefine SSL>
# SetEnvIf User-Agent ".*MSIE.*" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
# </IfDefine>
#</IfModule>
# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
# AcceptPathInfo On
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
# php_value session.use_trans_sid 0
php_value register_globals 1
UPDATE
基于edmondscommerce答案我搜索<?
与正则表达式<\?[\s]
,发现在2000点出现。
我也更新了application_top.php文件包括:
if (($session_started == true) && (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false)) {
extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
}
我不知道在哪里可以把这个代码片段文件中,如果它与下面的部分冲突,我不知道。
// check if sessions are supported, otherwise use the php3 compatible session class
if (!function_exists('session_start')) {
define('PHP_SESSION_NAME', 'osCsid');
define('PHP_SESSION_PATH', $cookie_path);
define('PHP_SESSION_DOMAIN', $cookie_domain);
define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
include(DIR_WS_CLASSES . 'sessions.php');
}
看起来像与您的PHP版本不兼容。 'register_globals'在PHP 5.4 –
@HoboSapiens中被删除,谢谢我使用PHP 5.5.9,OSC安装的远程服务器是PHP 5.3.2。你能想到这个吗? – Holly
如果您的应用程序需要'register_globals'并且它不再存在,那么不行,我想不出安装较低版本的PHP之外的解决方法。我不会立即知道你会得到一个。 –