Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Upgraded PHP to 5.X and my shopping cart is disabled.


danthony2

Recommended Posts

I need a little help, I just upgraded my hosting account with php5 and now my shopping cart is giving this error.

 

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

 

I checked the php.ini and it is enabled so I think it has to do with upgrade from 4.x to 5.x.

 

Thanks,

David

Link to comment
Share on other sites

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

Run the following script

<?php phpinfo(); ?>

to confirm that your php.ini settings are in fact being read and processed. Note that some hosts will not permit phpinfo() to be used. Some hosts running suPHP require a statement in .htaccess pointing to the php.ini file.

 

PHP 5 by default has register globals turned OFF. It is a good idea to upgrade to 2.2 RC2a, which doesn't use register global variables. By the time you get to PHP 6.0 (and maybe before that, perhaps as early as 5.3), you will not be able to use register global variables at all. Then you'll be in a real pickle if you haven't updated osC.

Link to comment
Share on other sites

Hey MrPhil,

 

You were right ...

 

register_globals Off Off

 

I don't have access to the location it specifies so should I contact my hosting company?

 

Loaded Configuration File /web/conf/php5.ini

 

Thanks,

David

 

 

Run the following script

<?php phpinfo(); ?>

to confirm that your php.ini settings are in fact being read and processed. Note that some hosts will not permit phpinfo() to be used. Some hosts running suPHP require a statement in .htaccess pointing to the php.ini file.

 

PHP 5 by default has register globals turned OFF. It is a good idea to upgrade to 2.2 RC2a, which doesn't use register global variables. By the time you get to PHP 6.0 (and maybe before that, perhaps as early as 5.3), you will not be able to use register global variables at all. Then you'll be in a real pickle if you haven't updated osC.

Link to comment
Share on other sites

You'll have to ask your hosting company whether you can turn "on" register global variables -- if so, and what command to put where. "/web/conf/php5.ini" sounds like a system configuration file, which you can't access. Usually on a shared server you can create your own "php.ini" file. See http://www.catskilltech.com/freeSW/SMF/faqs/index.html > Querying/Setting my PHP settings. If your level of PHP (or hosting company policy) doesn't permit register global variables to be "on", you'll need to upgrade to osC 2.2 RC2a, which doesn't use register globals and doesn't care if they're on or off.

Link to comment
Share on other sites

Hey MrPhil,

You rock! I contacted my hosting company and they told me all I had to do was rename php.ini to php5.ini and I did. All is good now I need to upgrade my shopping cart and hope all goes well.

 

Thanks,

David

 

 

You'll have to ask your hosting company whether you can turn "on" register global variables -- if so, and what command to put where. "/web/conf/php5.ini" sounds like a system configuration file, which you can't access. Usually on a shared server you can create your own "php.ini" file. See http://www.catskilltech.com/freeSW/SMF/faqs/index.html > Querying/Setting my PHP settings. If your level of PHP (or hosting company policy) doesn't permit register global variables to be "on", you'll need to upgrade to osC 2.2 RC2a, which doesn't use register globals and doesn't care if they're on or off.

Link to comment
Share on other sites

So all looked great until I tried accessing the Admin console.. got this error.

 

Fatal error: Cannot re-assign $this in /home/content/n/h/a/username2/html/store/admin/includes/classes/upload.php on line 31

 

Everything else on the front end is working great.

Link to comment
Share on other sites

So all looked great until I tried accessing the Admin console.. got this error.

 

Fatal error: Cannot re-assign $this in /home/content/n/h/a/username2/html/store/admin/includes/classes/upload.php on line 31

 

Everything else on the front end is working great.

See >>this .

Link to comment
Share on other sites

Hey MrPhil,

You rock! I contacted my hosting company and they told me all I had to do was rename php.ini to php5.ini and I did. All is good now I need to upgrade my shopping cart and hope all goes well.

 

Thanks,

David

 

 

Hi, where is the php.ini file located? I can't find it. Have the same problem. Use CPanel, but cannot find anywhere there to change register global from off to on.

 

Please help.

 

Thanks!

Best regards

Kjolebutikken

Link to comment
Share on other sites

 

 

Thanks, I read this:

 

# On a shared server, it's not uncommon for no default php.ini file to exist. That is, you will not find a php.ini file provided for you, no matter how hard you look. You have to create the file yourself, either using your host's control panel file editor, or creating it on your PC and uploading it.

 

Also, my host says I have to create my own php.ini file.

How do I do that? I can use Notepad ofcourse, but what should be the content in the file? I have no idea :-)

And what should I name it? php.ini or php5.ini, as suggested in this thread?

 

Thanks for all help :-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

Thanks, I read this:

 

 

 

Also, my host says I have to create my own php.ini file.

How do I do that? I can use Notepad ofcourse, but what should be the content in the file? I have no idea :-)

And what should I name it? php.ini or php5.ini, as suggested in this thread?

 

Thanks for all help :-)

 

 

OK, I tried to just create a file called php.ini (got confirmed from my host that I could cal it that), with this info that I copied from another thread:

 

display_errors=Off
display_startup_errors=Off
log_errors=On
magic_quotes_sybase=Off
magic_quotes_gpc=On
register_globals=On
error_log='/home/sites/domainetc/php.txt'
error_reporting=2147483647 
disable_functions='phpinfo'

 

I set register globals to ON

 

I uploaded the file to both public_html folder and to catalog folder. Did not know where to put it. What is correct?

 

 

Sadly I now get this error:

 

1046 - No database selected

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

 

Have I done something wrong?

Best regards

Kjolebutikken

Link to comment
Share on other sites

OK, I tried to just create a file called php.ini (got confirmed from my host that I could cal it that), with this info that I copied from another thread:

 

display_errors=Off
display_startup_errors=Off
log_errors=On
magic_quotes_sybase=Off
magic_quotes_gpc=On
register_globals=On
error_log='/home/sites/domainetc/php.txt'
error_reporting=2147483647 
disable_functions='phpinfo'

 

I set register globals to ON

 

I uploaded the file to both public_html folder and to catalog folder. Did not know where to put it. What is correct?

 

 

Sadly I now get this error:

 

 

 

 

Have I done something wrong?

 

 

I finally managed to fix this.

Created a new php.ini file and uploaded it to my public_html folder. Here I sat register globals to on.

Added an explanation in .htaccess for where to find the php.ini file.

Deleted database and mysql user and created new ones with new password.

Uploaded all databasefiles again.

Added user to database.

Changed the two configure.php files at least 50 times each, and finally, it works.

 

New problems:

 

1. No I get the warning that for some reason, sudenly customers get the warning that they can write to my catalog/includes/configure.php file.

 

2. I also am not able to open my admin. Get this error:

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@kjolegalleriet.no and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

I will try to search the forum and see if I can figure it out, but if any of you know the ansers, I'm very thankful for your advices :-)

 

Thanks :-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

New problems:

 

1. No I get the warning that for some reason, sudenly customers get the warning that they can write to my catalog/includes/configure.php file.

 

2. I also am not able to open my admin. Get this error:

 

 

 

I will try to search the forum and see if I can figure it out, but if any of you know the ansers, I'm very thankful for your advices :-)

 

Thanks :-)

 

 

Just wanted to let you know that I managed to solve these problems :-)

 

Error 1:

Changes the access settings for the file catalog/includes/configure.php in my Cpanel from 644 to 544. This removed the warning message at the top of my site. I had this changed when I made my store the first time, but for some reason the access settings was changed for the files after uploading them to the new host server.

 

Error 2:

I needed to change the path in the passwd code in admin/.htaccess file, to the correct new path to my storefiles :-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

Are you still having problems? In the instructions I pointed you to, it tells you to create a phpinfo script. You run that before and after creating your php.ini file to see if the settings change correctly per the php.ini file. If they don't, you did something wrong. Also, some host setups require an entry in .htaccess pointing to the php.ini file to use. Your host should be telling you what's needed. php.ini is usually placed in the site root, but can be anywhere in the chain of directories down to your store. It can even be outside of your public web tree, if you have an .htaccess entry pointing to it. BTW, 544 permissions make no sense. They should be 444. Read http://www.catskilltech.com/freeSW/SMF/faqs/index.html#perm

Link to comment
Share on other sites

No, the problems are gone :-)

 

I created a php.ini file

 

NB! I changed my php.ini. It now only invludes the code:

 

register_globals=On

 

 

Should I still create the phpinfo script?

 

I will change my setting to 444 :-)

 

 

Thanks!

Best regards

Kjolebutikken

Link to comment
Share on other sites

phpinfo is just needed for diagnosing problems with your php.ini setup, or seeing if you need to explicitly define some new setting. If you're happy with how things are running, you don't need it. Just keep it in mind for the next time you're wondering what setting PHP is using. Incidentally, don't leave it lying around for hackers to use -- rename it or erase it.

 

What are you changing to 444? (read-only) The two configure.php files need to be changed -- is that what you're referring to?

Link to comment
Share on other sites

phpinfo is just needed for diagnosing problems with your php.ini setup, or seeing if you need to explicitly define some new setting. If you're happy with how things are running, you don't need it. Just keep it in mind for the next time you're wondering what setting PHP is using. Incidentally, don't leave it lying around for hackers to use -- rename it or erase it.

 

What are you changing to 444? (read-only) The two configure.php files need to be changed -- is that what you're referring to?

 

 

Hi,

Yes, I'm only changing the setting for the two configure.php files :-)

 

What file need to be erased or renamed? phpinfo? Is this the one that hackers can use? Not php.ini? Or both?

 

 

Thanks :-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

phpinfo.php is the one to erase or rename. A hacker could run it and glean valuable information about system vulnerabilities from it. You need to have php.ini to hold PHP settings. You can ask your hosting service about commands to put in .htaccess (if an Apache server) to keep hackers from reading your php.ini file.

Link to comment
Share on other sites

phpinfo.php is the one to erase or rename. A hacker could run it and glean valuable information about system vulnerabilities from it. You need to have php.ini to hold PHP settings. You can ask your hosting service about commands to put in .htaccess (if an Apache server) to keep hackers from reading your php.ini file.

 

 

OK :-) Thank you so much for your advices :-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...