Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

register_globals for Dummies


twacking

Recommended Posts

Hi,

 

I have installed OS Commerce before and had no problems. I am installing it on another site and receive this message upon login. I have read many of the support responses regarding this issue but can make no sense of what I need to do. Could someone please attempt to explain to me what is required in very simple terms.

 

Thanks in advance for this as it seems it will solve a problems for many other users. :huh:

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

Link to comment
Share on other sites

Replace the contents of the .htaccess file in your site root with:

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# 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)
#
<IfModule mod_php4.c>
 php_value session.use_trans_sid 0
 php_value register_globals 1
</IfModule>

Options Indexes FollowSymLinks Includes 
AddType application/x-httpd-cgi .cgi 
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-htm .htm

 

This should get rid of your problem

Link to comment
Share on other sites

Install the register globals module

http://www.oscommerce.com/community/contributions,2097

 

I'm installing osCommerce (for the first time, ever) locally. I've changed the htaccess (as shown below), but I still get the same error, "Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory."

 

I'm not able to install the register_globals module, because I haven't yet installed osCommerce.

 

I'm new to this so any help is greatly appreciated.

 

Thanx.

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# 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)
#
<IfModule mod_php4.c>
 php_value session.use_trans_sid 0
 php_value register_globals 1
</IfModule>

Options Indexes FollowSymLinks Includes 
AddType application/x-httpd-cgi .cgi 
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-htm .html

Link to comment
Share on other sites

I'm installing osCommerce (for the first time, ever) locally. I've changed the htaccess (as shown below), but I still get the same error, "Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory."

 

I'm not able to install the register_globals module, because I haven't yet installed osCommerce.

 

I'm new to this so any help is greatly appreciated.

 

Thanx.

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# 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)
#
<IfModule mod_php4.c>
 php_value session.use_trans_sid 0
 php_value register_globals 1
</IfModule>

Options Indexes FollowSymLinks Includes 
AddType application/x-httpd-cgi .cgi 
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-htm .html

 

 

The problem is that quite a few hosting companies now have register globals turned off and will not let you change this or the permissions on your files. The register globals patch does work but it leaves your shop vulnerable unless you change the permissions on your files which is unlikely if your hosting company is giving you a hard time over register globals in the first place. Fasthosts, for example, wont you let you do either unless they're hosting your site on a linux server (even then it's only the permissions you can change so you still need to use the register globals patch). If you're being hosted on a windows IIE server then forget it.

 

Incidentially, if anyone can recommend a host that provides mysql databases, php, ssl and password restrictions and everything else need for e-commerce all in one and allows permissions to be changed and doesn't charge the earth then please feel free to let me know.

Link to comment
Share on other sites

I'm installing osCommerce (for the first time, ever) locally. I've changed the htaccess (as shown below), but I still get the same error, "Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory."

 

I'm not able to install the register_globals module, because I haven't yet installed osCommerce.

 

I'm new to this so any help is greatly appreciated.

 

Thanx.

 

Ok in that case in your local environment you can do whatever you like. You have full control over the php.ini so you can change the parameters to have register globals on and finish the installation. The question is with a live store what will happen and so is better to check the patch and learn how to configure osc manually without going through the installation process. (ie extract the osc archive, modify the configure.php files to match the server and install the globals patch at the top)

Link to comment
Share on other sites

Ok in that case in your local environment you can do whatever you like. You have full control over the php.ini so you can change the parameters to have register globals on and finish the installation. The question is with a live store what will happen and so is better to check the patch and learn how to configure osc manually without going through the installation process. (ie extract the osc archive, modify the configure.php files to match the server and install the globals patch at the top)

 

Ok, I'll give that a go. I don't want to change the phpini because I've got other projects on my dev server which require globals to be off. Just so I know, any ideas why the htaccess didn't work?

Link to comment
Share on other sites

I think you need to add to the httpd.conf the appropriate directives to allow overrides for specific folder(s)

 

<Directory "C:/server/sitename/whatever">

AllowOverride All

allow from all

</Directory>

 

Kinda specific to your environment. But you can do whatever you want with these rules I can map a local ip to the domain and then simulate 100% the environment before going on-line with an osc store.

Link to comment
Share on other sites

Yeah, That's what's confusing me.

 

My httpd.conf file is set correctly & htaccess is working fine on the server, I use it to enable rewriting for friendly URL's, etc., on other projects. Just wondered if there's a reason why this htaccess might not work?

Link to comment
Share on other sites

what happens if you force it within the httpd.conf for specific directories.

 

<Directory "C:/server/sitename/whatever">

php_value register_globals 1

</Directory>

 

does it work?

Link to comment
Share on other sites

I'm not sure because I've already installed the register globals module.... work's great BTW!

I'm very interested to know why the htaccess wouldn't work, so If I get time I'll do a second installation to try your recommendation.

 

Thanks for the help.

Link to comment
Share on other sites

The problem is that quite a few hosting companies now have register globals turned off and will not let you change this or the permissions on your files. The register globals patch does work but it leaves your shop vulnerable unless you change the permissions on your files which is unlikely if your hosting company is giving you a hard time over register globals in the first place. Fasthosts, for example, wont you let you do either unless they're hosting your site on a linux server (even then it's only the permissions you can change so you still need to use the register globals patch). If you're being hosted on a windows IIE server then forget it.

 

Incidentially, if anyone can recommend a host that provides mysql databases, php, ssl and password restrictions and everything else need for e-commerce all in one and allows permissions to be changed and doesn't charge the earth then please feel free to let me know.

 

 

 

Hi,

 

Thanks for your advice :thumbsup: . I e-mailed my hosting service , and they turned globals for me in less than 10 minutes. I would recommend them as I have had excellent service from them for years.

 

Cheers,

Nicholle

Link to comment
Share on other sites

...The register globals patch does work but it leaves your shop vulnerable unless you change the permissions on your files...

Assuming you are referring to the .htaccess method when you ref. "register globals patch", you ought to know that this has nothing at all to do with file permissions. The Register Globals issue is completely independent of any file permissions you may or may not have set, and changing one does not affect the security (or otherwise) of the other.

 

Rich.

Link to comment
Share on other sites

...I'm very interested to know why the htaccess wouldn't work...

Whether or not .htaccess works or not is something that is controlled from php.ini - the functionality can be switched on or off.

 

So, if php.ini has been set up securely then .htaccess will not work (Apache will not even bother to look for .htaccess files), thus scuppering your cunning plan!

 

Rich.

Link to comment
Share on other sites

Whether or not .htaccess works or not is something that is controlled from php.ini - the functionality can be switched on or off.

 

So, if php.ini has been set up securely then .htaccess will not work (Apache will not even bother to look for .htaccess files), thus scuppering your cunning plan!

 

Rich.

 

 

Ok. I thought that the idea was to use the htaccess as a local (folder level) override to the phpini file (ie, the phpini file has regidester_globals disabled, but they are enabled in a specific folder by the use of htaccess)? Are you saying that this is incorrect? The onscreen instructions during installation claim this:

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file OR in the .htaccess file in your catalog directory.

Link to comment
Share on other sites

Whether or not .htaccess works or not is something that is controlled from php.ini - the functionality can be switched on or off.

 

So, if php.ini has been set up securely then .htaccess will not work (Apache will not even bother to look for .htaccess files), thus scuppering your cunning plan!

 

Rich.

Sorry - my previous post contained a typo - It should have ref'd httpd.conf, NOT php.ini

 

.htaccess has nothing to do with php.

 

So....

 

Whether or not .htaccess works or not is something that is controlled from httpd.conf - the functionality can be switched on or off.

 

So, if httpd.conf has been set up securely then .htaccess will not work (Apache will not even bother to look for .htaccess files), thus scuppering your cunning plan!

 

Sorry about any confusion,

 

Rich.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...