We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8619
    • 229 Posts
    I did not try using the ’uri’ solution from network solutions, and I can say that the solution about fixing the config.inc.php file did work for me.

    I am using the Unix hosting package with NS.

      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: sottwell at Apr 11, 2007, 07:45 AM

      I have been thinking that it might be better to have those values calculated at install time and verified by the installer, then written to the database or the config file. This auto-configuration seems to be having problems lately.
      There are two different issues you are dealing with Susan; that of mis-configured servers with MODx 0.9.5, such as Network Solutions after this upgrade, and that of a change to the auto-configuration code in 0.9.6 release candidates. The 0.9.6 changes PHP_SELF to SCRIPT_NAME, which is a separate problem. IMO, this should go back to PHP_SELF, and remain auto-configured unless a user overrides those settings to avoid server configuration issues (i.e. where you do not have control over the PHP configuration yourself).

      From php.net:
      ’PHP_SELF’

      The filename of the currently executing script, relative to the document root. For instance, $_SERVER[’PHP_SELF’] in a script at the address http://example.com/test.php/foo.bar would be /test.php/foo.bar. The __FILE__ constant contains the full path and filename of the current (i.e. included) file.

      I do not believe Network Solutions is setup properly in this case, and making exceptions for them contrary to PHP documentation is not on my to-do list.
        • 15871
        • 105 Posts
        Uuugh NetSol. I tried the implementation suggested to the config.inc.php file and get this error:

        Warning: loadextension(MODX_BASE_PATHmanager/includes/extenders/dbapi.mysql.class.inc.php) [function.loadextension]: failed to open stream: No such file or directory in /data/12/1/129/15/1129015/user/1196771/htdocs/beta/manager/includes/document.parser.class.inc.php on line 39

        Warning: loadextension() [function.include]: Failed opening ’MODX_BASE_PATHmanager/includes/extenders/dbapi.mysql.class.inc.php’ for inclusion (include_path=’.:/usr/services/vux/lib/php’) in /data/12/1/129/15/1129015/user/1196771/htdocs/beta/manager/includes/document.parser.class.inc.php on line 39
        Could not load DBAPI class.
          • 8619
          • 229 Posts
          Did you change the uri setup that NetSol told you to change in the first place? I never changed it, commented out the section, added the other 3 lines, and it works for me now.
            • 15871
            • 105 Posts
            OK, so here’s the new info from NetSol.

            They are on Apache 2.2 and the htaccess rules have changed as well as the PHP_SELF

            They suggested using SCRIPT_URL instead for the PHP_SELF - that works

            Then on the htaccess file, apparently phpflag and on/off is no longer supported. htaccess needs to state "php_value register_globals 0" in order to work.

            HOWEVER

            Since I have done this and register_globals is still on, AND I still get 401 errors when FURLs are on, I believe the server is not reading the htaccess file. I have a support call to see if they can set the allowOverride to All or something other than none. will post solution when I get it resolved so everyone else can kick NetSol into gear.
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              You can easily confirm if your htaccess is being read by:

              1. Rewriting all URLs to google.com (that way you know it was read)
              2. If you are getting an error WITH .htaccess as opposed to, say, an empty .htaccess file (and no errors)

              etc...

              Quote from: "php.net"

              Warning:
              $_SERVER[’PHP_SELF’] and $_SERVER[’SCRIPT_NAME’] may not always be set correctly.
              Some web hosts implement php as a CGI in such a way that they can turn it on or off for each virtual domain. Several $_SERVER and $_ENV variable values may be incorrect for documents in subdirectory sub-domains of these virtual domains.

              Personally, I’d go with the $_server global and make sure your directives are correct.

              How does
              $_ENV[’SCRIPT_URL’]
              work compared to
              $_SERVER[’SCRIPT_URL’]
              ...if at all?

              A quote on ENV vs SERVER scope

              The $_env superglobal variables are imported into PHP’s global namespace from the environment under which the PHP parser is running. Many are provided by the shell under which PHP is running and different systems are likely running different kinds of shells, a definitive list is impossible. The PHP manual advises to see your shell’s documentation for a list of defined environment variables.

              The entries in the $_server array are created by the webserver.

              Personally, I’d go with the $_server global and make sure your directives are correct.
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 22303 MODX Staff
                • 10,725 Posts
                Can you NetSol folks try this block to replace the current automatic path configuration in config.inc.php? Let me know if it works for you. This is the solution we are testing for 0.9.6 and I’m curious how it might relate to these issues with NetSol.
                    // automatically assign base_path and base_url
                    if (empty ($base_path) || empty ($base_url) || $_REQUEST['base_path'] || $_REQUEST['base_url']) {
                    
                        // assign base_path
                        $base_path= realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..') . DIRECTORY_SEPARATOR;
                        $base_path= str_replace('\\', '/', $base_path);
                        if ($base_path{strlen($base_path) - 1} != '/') $base_path .= '/';
                    
                        // strip appended paths
                        $base_url= !empty ($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['REQUEST_URI'];
                        $base_url= str_replace('\\', '/', $base_url);
                        $truncate= strpos($base_url, !empty ($_SERVER['SCRIPT_FILENAME']) ? basename($_SERVER['SCRIPT_FILENAME']) : '.php');
                        if ($truncate !== false)
                            $base_url= substr($base_url, 0, $truncate);
                    
                        // walk trough url until we reach our base directory
                        $base_url_tokens= explode('/', $base_url);
                        while (count($base_url_tokens) > 0) {
                            $base_url= implode('/', $base_url_tokens);
                            if (preg_match('/' . preg_quote($base_url, '/') . '[\/|]$/', $base_path))
                                break;
                            array_pop($base_url_tokens);
                        }
                    
                        if ($base_url{strlen($base_url) - 1} != '/') $base_url .= '/';
                    
                        // assign site_url
                        $site_url= ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port) ? 'https://' : 'http://';
                        $site_url .= $_SERVER['HTTP_HOST'];
                        if ($_SERVER['SERVER_PORT'] != 80)
                            $site_url= str_replace(':' . $_SERVER['SERVER_PORT'], '', $site_url); // remove port from HTTP_HOST 
                        $site_url .= ($_SERVER['SERVER_PORT'] == 80 || (isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port) ? '' : ':' . $_SERVER['SERVER_PORT'];
                        $site_url .= $base_url;
                    }
                

                Code courtesy of netnoise. Thanks netnoise...
                  • 8619
                  • 229 Posts
                  Tried it, and get this error message:

                  Warning: loadextension(MODX_BASE_PATHmanager/includes/extenders/dbapi.mysql.class.inc.php) [function.loadextension]: failed to open stream: No such file or directory in /data/12/1/136/35/1136687/user/1207121/htdocs/manager/includes/document.parser.class.inc.php on line 39

                  Warning: loadextension() [function.include]: Failed opening ’MODX_BASE_PATHmanager/includes/extenders/dbapi.mysql.class.inc.php’ for inclusion (include_path=’.:/usr/services/vux/lib/php’) in /data/12/1/136/35/1136687/user/1207121/htdocs/manager/includes/document.parser.class.inc.php on line 39
                  Could not load DBAPI class.
                    • 22303 MODX Staff
                    • 10,725 Posts
                    @ejcross, you are still missing the MODX_BASE_PATH constant in your config.inc.php. That value is not getting set properly. Make sure it is getting set properly in config.inc.php. Compare with the original config.inc.php to make sure you still have the lines assigning the constants.
                      • 8619
                      • 229 Posts
                      Ok, missed that....

                      Your file update works with this added at the bottom, plus the rest of the config file:

                      $base_url = ’/’;
                      $site_url = ’http://www.unionky911.org/’;
                      $base_path = ’/data/12/1/136/35/1136687/user/1207121/htdocs/’;

                      if (!defined(’MODX_BASE_PATH’)) define(’MODX_BASE_PATH’, $base_path);
                      if (!defined(’MODX_BASE_URL’)) define(’MODX_BASE_URL’, $base_url);
                      if (!defined(’MODX_SITE_URL’)) define(’MODX_SITE_URL’, $site_url);

                      Is that right then? It does work just fine so far!

                      Thanks and I’ll keep testing it....