We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11927
    • 105 Posts
    So I got this warning from the manager.
    "Configuration warning: register_globals is set to ON in your php.ini configuration file"

    I tried putting the php.ini file with "register_globals = off" in it, into the /manager folder and got this when I hit refresh in the manager.
    "Fatal error: Class ’PDO’ not found in [root]/public_html/trans/core/model/modx/modx.class.php on line 348"

    I also tried putting a blank php.ini file into the /manager directory and got the same fatal error.


    Fresh install: Traditional Revo 2.0.2 (yesterday on subdomain)
    Server OS: Linux CentOS (2.6.34.6 ?)
    Php: 5.2.14 (my host says it’s 5.2.4)
    mysql: 5.1.50
    pdo_mysql: 5.1.50
    Browser: FF 3.6.9
    other things: ?
      You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx. smiley

      Carpet Cleaning
      • 5340
      • 1,624 Posts
      than do it in the .htaccess file

      maybe like this: php_flag register_globals 0

      Anyway, if I remember correctly PHP5 should have register global OFF by default.
        • 11927
        • 105 Posts
        I can’t because my host won’t let me change register_globals in .htaccess. I have done this before in Evo 0.9.6 and 1.0.3. Both have been done in a php.ini file on a subdomain. Is it the subdomain with Revo that is messing it up?

        When I put the php.ini file in the root of the subdomain I get the same error when I visit the subdomain main page.

        The register_globals may be off in php5 by default, but my host has it set to on (shared hosting).
          You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx. smiley

          Carpet Cleaning
          • 5340
          • 1,624 Posts
          Than I can’t really help. Maybe someone from the team has an idea.
          BTW there are tons of companies that offer proper shared hosting. Maybe you’d like to try a different one

            • 21257 MODX Staff
            • 730 Posts
            What if you put the following at the bottom of your custom php.ini file:

            extension=pdo.so
            extension=pdo_mysql.so
            
              Mike Schell
              Lead Developer, MODX Cloud
              Email: [email protected]
              GitHub: https://github.com/netProphET/
              Twitter: @mkschell
              • 11927
              • 105 Posts
              I put that after register_globals = off, and my error went away. But I also put that in the php.ini without register_globals = off and the error went away.

              So is it really turning off the register_globals?

              Could you explain the code?
                You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx. smiley

                Carpet Cleaning
                • 21257 MODX Staff
                • 730 Posts
                Your error message was complaining that it couldn’t find PDO, so I thought that maybe for some reason, having a php.ini file in your site might be turning that extension off in php. So those 2 lines just turn it on, make sure that the PDO extension is loaded.
                PDO has nothing to do with register globals. I was just offering a fix to your fix. Seems odd, but if it works...
                  Mike Schell
                  Lead Developer, MODX Cloud
                  Email: [email protected]
                  GitHub: https://github.com/netProphET/
                  Twitter: @mkschell