Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cannot get past this 'register_globals is disabled in php.ini, please enable it!' HELP


Guest

Recommended Posts

Total new'be

 

register_globals is disabled in php.ini, please enable it!

 

Followed install instruction. Changed CHMOD's and typed in www.myserver.co.uk/install, and Fatal Errror as above has appeared.

 

1 how do i access my php.ini

2 where is my ftaccess file

3 any other help ?

 

I am sorry if this is a stupid and common question...doh

Link to comment
Share on other sites

On a shared server it's unlikely you'll have access to a local php.ini file, but if you do then it will most likely be in a folder called 'etc'

 

You certainly won't have access to the main php.ini file - which covers the whole server.

 

Two choices:

 

1. Create a file called php.ini and put it in the root of your web, and inside the 'admin' folder, with this code in it:

register_globals = On

 

2. If the server is Apache and not Windows then you can try putting this code in a .htaccess file in the root of your web:

php_flag register_globals On

 

If you have the Google Toolbar installed in your browser then in future put what you're looking for info on into the Googe Search box and tell it to Search This Site - and it will bring up relevant results from this forum - much better than the osCommerce Search fuction.

 

Vger

Link to comment
Share on other sites

Is this the right file to be placing your code?

 

It is the only htaccess file i can see.

 

 

# -FrontPage-

 

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

 

<Limit GET POST>

order deny,allow

deny from all

allow from all

</Limit>

<Limit PUT DELETE>

order deny,allow

deny from all

</Limit>

AuthName www.sugarplumtree.co.uk

AuthUserFile /home/sites/sugarplumtree.co.uk/web/_vti_pvt/service.pwd

AuthGroupFile /home/sites/sugarplumtree.co.uk/web/_vti_pvt/service.g

 

cheers

Nick

Link to comment
Share on other sites

If the server is Apache and not Windows then you can try putting this code in a .htaccess file in the root of your web:

php_flag register_globals On

Vger

 

This worked for me, thanks Vger. The problem was I couldn't see a php.ini file or a .htaccess file. I created an .htaccess file with

php_flag register_globals On

 

Upload to the root folder, problem solved. Seems like there are a lot of different solutions to this problem depending on what kind of server you use.

Link to comment
Share on other sites

hi all

 

was getting the problem indicated in post1.

 

however now i have put a .htaccess with

 

php_flag register_globals On

 

in the root folder of my website

 

i now get an error 500

 

anyone got any ideas what i've done wrong? and more importantly how to resolve this problem :(

 

 

the htaccess file literally has the 1line above quoteed in it nothing else

Link to comment
Share on other sites

# $Id: .htaccess,v 1.1 2003/06/20 00:18:30 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>

 

Does anyone no what this is telling me to do or not to do, this is contained in my htaccess file in each folder.

 

Hope my lack of understanding coding is not causing nay offence.

 

Cheers Ears

 

Nick

Link to comment
Share on other sites

If you put the code in that I recommended and you get a 500 error then this means that you are either:

 

1. On a Windows server.

2. On an Apache server where the web host does not allow you to alter the settings for Register Globals via .htaccess.

 

You pt the code that I recommended at the end of an existing .htaccess file in the root of your website only - no need to put it in each and every sub-folder.

 

Vger

Link to comment
Share on other sites

If you put the code in that I recommended and you get a 500 error then this means that you are either:

 

1. On a Windows server.

2. On an Apache server where the web host does not allow you to alter the settings for Register Globals via .htaccess.

 

You pt the code that I recommended at the end of an existing .htaccess file in the root of your website only - no need to put it in each and every sub-folder.

 

Vger

 

Thanks Vger

 

I have sent an e-mail to server I hope of sorting problem. I will inform the Community of the out come. Thanks for your help, but your code did not work this time, heres hoppong my web host can configure it.

Link to comment
Share on other sites

Thanks Vger

 

I have sent an e-mail to server I hope of sorting problem. I will inform the Community of the out come. Thanks for your help, but your code did not work this time, heres hoppong my web host can configure it.

 

Hi - It's likley you'll need to do this :

 

If the host uses suPHP to parse php files, you have the option of using a custom php.ini file.

 

Your hosting account can have multiple php.ini files on your account in different

folders so you can customize the php processing in different folders should

your script require it. A php.ini file will not inherit down into subfolders,

however, you can create a .htaccess file in the same folder as the php.ini file

and place the following code into it:

 

suPHP_ConfigPath /home/yourusername/public_html/path/to/php.ini

 

This will cause the php.ini file to affect all subfolders, unless a php.ini file is in a subfolder, at which point

the php.ini in the subfolder takes precendence.

 

In php.ini, you will need to use the actual php.ini syntax instead of the

php_value or php_flag syntax you would normally use in .htaccess (Which should

not be used at all):

 

setting_name = setting_value

 

So, this means if you move the settings from .htaccess to php.ini, you must

convert the format. Let's say you have the following line in your .htaccess

file:

 

php_value register_globals 0

 

the corresponding php.ini format is as follows:

 

register_globals = Off

 

Notice how the value 0 becomes Off and 1 becomes On. Now if your php_value has

quotes like the following, for example:

 

php_value include_path ".:/home/user/lib"

 

The corresponding php.ini format is:

 

include_path = ".:/home/user/lib"

 

and so on. You can see a list of entries you can use in your php.ini file at

http://us2.php.net/manual/en/ini.php . You should only use the settings you

need to change in your php.ini.

 

For the PHP settings you do not have in your php.ini file, PHP will use our

default configurations.

Link to comment
Share on other sites

  • 1 month later...

ok from what I understood i needed to put this

register_globals = Off

 

its still not working

 

this is what I have in htaccess file

 

# $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>

 

# 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>

 

 

so I only added to php.ini the register globals line

 

I am not expert with this so I dont know in 100% what to do sorry

I hope you can help me

thanks

Link to comment
Share on other sites

  • 2 months later...

ive just uploaded to my hosting and ive also getting FATAL ERROR: register_globals is disabled in php.ini, please enable it!

 

having amended the .htaccess at public_html level ive found the file contents have been amended by the server with the following message

 

# File modified on Wed Mar 14 06:19:30 2007 by server

# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives

# php_value register_globals 1

 

i use bluehosts.com and their control panel info is as below

 

Operating system Linux

Service Status Click to View

Kernel version 2.6.19-1_3.BHsmp

Apache version 1.3.37 (Unix)

PERL version 5.8.7

Path to PERL /usr/bin/perl

Path to sendmail /usr/sbin/sendmail

Installed Perl Modules Click to View

PHP version 4.4.4

MySQL version 4.1.21-standard-log

 

 

I do not know where to start as im new to php coming from a windows background and would appreciate any help or guides as to how I can get this to work.

 

thanks in advance.

 

Rob. :rolleyes:

Link to comment
Share on other sites

  • 1 month later...

Hi everyone.

 

I have read everything in these listings and tried I think all.

I am having similar problems with these .htaccess and php.ini files.

 

Like most other persons, I have never had this problem before. My error message is: -

 

"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."

 

This is what my .htaccess file looks like:-

 

# $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

php_flag register_globals On

</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

 

 

And this is what my php.ini file looks like:-

 

function tep_session_is_registered($variable) {

// >>> BEGIN REGISTER_GLOBALS

// return session_is_registered($variable);

return (isset($_SESSION) && array_key_exists($variable,$_SESSION));

// register_globals = On

// <<< END REGISTER_GLOBALS

}

 

 

 

Please take a close look and tell me what could be wrong.

 

I also notice that there are more than one .htaccess and php.ini files installed. Should that be so.

 

One (1) in the root and one (1) in the Admin folder.

BG

 

Making the internet community better. Knowledge is power.

Link to comment
Share on other sites

  • 10 months later...

Hi Vger,

I too am getting the FATAL ERROR: register_globals is disabled in php.ini, please enable it! error and have tried putting the .ini file and .htaccess files in the root folder www.mydomain.co.uk/catalog/

This does not work.

 

I then tried applying your REGISTER GLOBALS patch by replacing the respective files with your ones. This gets round the REGISTER GLOBALS issue however when I install a purchased jewellery template of OSCommerce, none of the products appears and I get a long SQL error showing where the products should be.

 

Driving miss daisy mad!

 

Is this a faulty template or have I overwritten some important stuff with the REGISTER GLOBALS patch.

 

Your expertise needed please!! :'(

 

Thanks

DynaMO

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...