We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16583
    • 15 Posts
    ehm...
    now it is my setup/index.php
    <?php
    /*
     * MODx Revolution
     *
     * Copyright 2006, 2007, 2008 by the MODx Team.
     * All rights reserved.
     *
     * This program is free software; you can redistribute it and/or modify it under
     * the terms of the GNU General Public License as published by the Free Software
     * Foundation; either version 2 of the License, or (at your option) any later
     * version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     * details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
     * Place, Suite 330, Boston, MA 02111-1307 USA
     */
    /**
     * Instantiates the setup program.
     *
     * @package modx
     * @subpackage setup
     */
    define('XPDO_MODE', 2);
    
    /* do a little bit of environment cleanup if possible */
    @ ini_set('magic_quotes_runtime', 0);
    @ ini_set('magic_quotes_sybase', 0);
    
    /* set error reporting */
    error_reporting(E_ALL & ~E_NOTICE);
    
    /* start session */
    session_start();
    
    /* check for compatible PHP version */
    define('MODX_SETUP_PHP_VERSION', phpversion());
    $php_ver_comp = version_compare(MODX_SETUP_PHP_VERSION, '4.3.3');
    if ($php_ver_comp < 0) {
        die('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>Wrong PHP version! You\'re using PHP version '.MODX_SETUP_PHP_VERSION.', and MODx requires version 4.3.3 or higher.</p></body></html>');
    }
    
    /* session loop-back tester */
    if ((!isset($_GET['s']) || $_GET['s'] != 'set') && !isset($_SESSION['session_test'])) {
        $_SESSION['session_test']= 1;
        $installBaseUrl= (!isset ($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') ? 'http://' : 'https://';
        $installBaseUrl .= $_SERVER['HTTP_HOST'];
        if ($_SERVER['SERVER_PORT'] != 80)
            $installBaseUrl= str_replace(':' . $_SERVER['SERVER_PORT'], '', $installBaseUrl); // remove port from HTTP_HOST
        $installBaseUrl .= ($_SERVER['SERVER_PORT'] == 80 || isset ($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on') ? '' : ':' . $_SERVER['SERVER_PORT'];
        echo "<html><head><title>Loading...</title><script>window.location.href='" . $installBaseUrl . $_SERVER['PHP_SELF'] . "?s=set';</script></head><body></body></html>";
        exit ();
    } elseif (isset($_GET['s']) && $_GET['s'] == 'set' && !isset($_SESSION['session_test'])) {
        die('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>Make sure your PHP session configuration is valid and working.</p></body></html>');
    }
    
    $setupPath= strtr(realpath(dirname(__FILE__)), '\\', '/') . '/';
    define('MODX_SETUP_PATH', $setupPath);
    $installPath= strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/';
    define('MODX_INSTALL_PATH', $installPath);
    
    if (!include(MODX_SETUP_PATH . 'includes/config.core.php')) {
        die ('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>Make sure you have uploaded all of the setup/ files; your setup/includes/config.core.php file is missing.</p></body></html>');
    }
    if ((defined('XPDO_MODE') && XPDO_MODE == XPDO_MODE_EMULATED) || (version_compare(MODX_SETUP_PHP_VERSION, '5.1') < 0) && !extension_loaded('mysql')) {
        die ('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>MODx requires the mysql extension when using PHP without native PDO and it does not appear to be loaded.</p></body></html>');
    }
    if ((defined('XPDO_MODE') && XPDO_MODE == XPDO_MODE_NATIVE) || (version_compare(MODX_SETUP_PHP_VERSION, '5.1') >= 0) && !extension_loaded('pdo')) {
        die ('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>MODx requires the PDO extension when native PDO is being used and it does not appear to be loaded.</p></body></html>');
    }
    if ((defined('XPDO_MODE') && XPDO_MODE == XPDO_MODE_NATIVE) || (version_compare(MODX_SETUP_PHP_VERSION, '5.1') >= 0) && extension_loaded('pdo') && !extension_loaded('pdo_mysql')) {
        die ('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>MODx requires the pdo_mysql driver when native PDO is being used and it does not appear to be loaded.</p></body></html>');
    }
    if (!include(MODX_SETUP_PATH . 'includes/modinstall.class.php')) {
        die('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>Make sure you have uploaded all of the setup/ files; your setup/includes/modinstall.class.php file is missing.</p></body></html>');
    }
    if (!file_exists(MODX_CORE_PATH) || !is_dir(MODX_CORE_PATH)) {
        die ('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>Make sure you have specified a valid MODX_CORE_PATH in your setup/includes/config.core.php file; this must point to a working MODx core.</p></body></html>');
    }
    if (!file_exists(MODX_CORE_PATH . 'cache/') || !is_dir(MODX_CORE_PATH . 'cache/') || !is_writable(MODX_CORE_PATH . 'cache/')) {
        die('<html><head><title></title></head><body><h1>FATAL ERROR: MODx Setup cannot continue.</h1><p>Make sure your MODX_CORE_PATH/cache directory exists and is writable by the PHP process.</p></body></html>');
    }
    
    $modInstall = new modInstall();
    $modInstall->loadLang();
    $modInstall->loadRequestHandler();
    $modInstall->request->loadParser();
    $modInstall->request->handle();


    and always dies with the same code.

    Pointing to root/index.php
    I’ve a strange error "503 Error"
    not "Error 503" like reported in index.php!
    Anyway, setup has never been executed.
      • 22303 MODX Staff
      • 10,725 Posts
      PHP 5.2.what? Ignore all this stuff about manually editing XPDO_MODE for now; I think you have another problem, but you need to provide a lot more details about your environment and make sure you have followed all the instructions. You do need to make sure the PDO_mysql extension is enabled, otherwise, you’re going to run into problems. But it honestly makes no sense to run any version of PHP 5.2 without the MySQL PDO driver; you’d lose all the benefits of using PDO which is one of the major benefits of Revolution. These workarounds folks are getting you to try may work, but it’s not optimal, believe me.
        • 16583
        • 15 Posts
        Ok, stop, sorry!
        Where are *all* the instructions?

        My provider show this server specification:
        Apache ver.  2.2.10 (Unix)
        PHP version 5.2.*
        MySQL ver. 5.0.51-community
        Activated On 2008-12-08 10:42
        Status Active

        Please, point me to test the PDO_MySQL extension.
          • 20289
          • 958 Posts
          @LAj

          You need to make the pdo drivers activated by uncommenting below two lines in your php.ini files;

          extension=php_pdo.dll
          extension=php_pdo_mysql.dll


          Even i had the same error! because of uncommenting the first line and leaving the other-one commented thus inactive.
            [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
            [td][Wiki] [Persian support forum]
            [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
            [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
            • 16583
            • 15 Posts
            So,
            there is not documentations.
            You are joking me! laugh

            I’ll ask my provider, thank you.
              • 28215
              • 4,149 Posts
              Quote from: LAj at Dec 17, 2008, 01:41 PM

              So,
              there is not documentations.
              You are joking me! laugh
              It’s a community-driven, free product not even yet in beta.
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 16583
                • 15 Posts
                I know it, don’t worry.

                However, I’ve found the php configuration of the server and pdo is disabled: "http://server15.000webhost.com/phpinfo.php"
                  • 15469
                  • 64 Posts
                  Unfortunately, my original php5 that came with Mac OS X 10.5.6 doesn´t have the PDO_MYSQL.
                  Is there any solution for those using macintosh and who don´t want to compile an own version of PHP into their systems?
                  Even if I might get PHP to work on my Mac, I´d prefer to rather use the PHP that came along with it...

                  Thanks in advance for giving me any hints on that issue.
                    $cd /pub
                    $more beer
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: Katzenfutter at Feb 23, 2009, 01:24 PM

                    Unfortunately, my original php5 that came with Mac OS X 10.5.6 doesn´t have the PDO_MYSQL.
                    Is there any solution for those using macintosh and who don´t want to compile an own version of PHP into their systems?
                    Even if I might get PHP to work on my Mac, I´d prefer to rather use the PHP that came along with it...

                    Thanks in advance for giving me any hints on that issue.
                    If you are installing from SVN, you can now force the use of xPDO’s built-in PDO emulation layer that was intended to allow PHP 4.3.3+/4.4.x (and 5.0.x) users to take advantage of xPDO and MODx as a workaround. At the moment however, this must be done manually by editing all of the config.core.php files, adding a define:
                    define('XPDO_MODE', 2);

                    This file is located in the following locations:
                    [*] MODX_SETUP_PATH/includes (e.g. /setup/includes/)
                    [*] MODX_BASE_PATH (e.g. /)
                    [*] MODX_MANAGER_PATH (e.g. /manager/)
                    [*] MODX_CONNECTORS_PATH (e.g. /connectors/)

                    Edit the one in setup/includes/ first, then run setup. Once setup is complete, you can then edit the other three files.

                    FYI, I just committed a fix to setup/index.php to allow setup on these systems; prior to this it is not possible due to install checks. It is not fully tested however, so proceed with these configurations at your own risk, though we certainly appreciate any and all feedback from these environments.

                    FWIW, I use OS X with MAMP, which does have PDO_MYSQL and everything is running fine.
                      • 15469
                      • 64 Posts
                      Thanks mate... I´ll have a look at it the next days. I´m somewhat busy wink
                      I just had a new install of apache 2.2, mysql 5.* and php 5.2.8 with PDO on my testing machine.
                      Everything works as expected now. Even on Mac smiley

                      I don´t want any things like Xampp or Mamp messing my system.
                      I like those things running natively on my machines.
                      Might sound a bit confusing, but I like turning some screws...
                        $cd /pub
                        $more beer