Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2005
    Location
    TN
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scripts Not Working Since Host Change

    Hello. I recently switched web hosts, and I uploaded all of my PHP scripts exactly the same as on my old site, but for some reason most of them don't work. The version isn't too different...my old host had 4.4.7 and my new one had 4.4.6 until they changed it to 5.1.6. It may be that all scripts with mySQL don't work, but I'm not sure, and I am connected to the database properly. If you have any ideas of what may be going on, please let me know. Thanks in advance!
    Last edited by chizu; 08-24-2007 at 10:56 PM.

  • #2
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    It could be any number of things, and it would be impossible to say for sure with the information you provided.

    You mention potential problems with scripts involving MySQL. Although you are connected to the MySQL server properly, are your scripts? Have you verified that the login information for each of these scripts is still valid with your new hosting setup (db user names, db passwords, etc)?

    Do your scripts rely on register_globals being on but your new host has them set off?

    Do your scripts rely on short php tags where your new host requires long tags?

    to mention but a few

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,044
    Thanks
    2
    Thanked 316 Times in 308 Posts
    When a script does not work between different servers or due to a version upgrade, 99% of the time it is due to configuration difference and 1% of the time it is actually due to version differences.

    There are likely runtime errors being generated that will help point to where the problem is. Either check your web server log for errors and/or turn on full php error reporting (display_errors to on and error_reporting to E_ALL) in a .htaccess file.

    I suspect register_globals, but if it seems to be limited to database access, the hostname in your database connection details is probably different.

    At what point did your scripts stop working? When you moved to the new host or when he upgraded to PHP5?
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    New Coder
    Join Date
    Jul 2005
    Location
    TN
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The scripts stopped working when I switched to my new host. Some of the scripts seem to work halfway, but anything involving mySQL seems to not work. Like, on my login script, the cookie that says that you are logged in gets set to TRUE, but the username cookie does not get set. And the strange thing is that all of my forums do not work except for one thread. I will try register_global settings and change my error display. Thanks for your help.

  • #5
    New Coder
    Join Date
    Aug 2007
    Location
    Wagga, Australia
    Posts
    59
    Thanks
    0
    Thanked 1 Time in 1 Post
    Yeah you will have to debug your coding and edit it to work with the new hosts settings

  • #6
    New Coder
    Join Date
    Jul 2005
    Location
    TN
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried changing the register_globals setting and it worked. Thanks for your help everyone!

  • #7
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,044
    Thanks
    2
    Thanked 316 Times in 308 Posts
    Register_globals are being eliminated in PHP6, because they were a bad idea - getting the language to automatically do something that the programmer should have only done specifically when necessary. It is best if you starting finding and fixing the things in your code that are dependent on register_globals now, when you have time, rather than later when PHP6 is released and your web host upgrades and you would be forced to fix them in a hurry or move to a web host that has not upgraded yet.

    Register globals were turned off by default starting in php Version 4.2.0 on 22-Apr-2002. At that point in time, php.net began recommending that no new code be written that depends on register globals being on.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •