We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14542
    • 13 Posts
    Hi,

    I have just installed Modx and I’m having some problems logging in. All that happens is the login page resets after the correct passwords are entered and ’Login’ is clicked.

    Below is the server setup.

    Modx Evolution 1.0.4

    Server Info

    Linux 5.3.2

    MySQL version 5.0.91-community
    Apache version 2.2.15
    PHP version 5.3.2

    Browsers:

    Firefox 3.6.8
    Safari 5.0
    **Same problem happens in both.

    I have a php.ini containing;

    safe_mode = Off
    magic_quotes_gpc = off


    Any help would be appreciated.
    • Was this working at some point? Or is this a brand new install?

      Sometimes I’ve had to manually reset login permissions in the database after updating...
        • 14542
        • 13 Posts
        It was working straight after the install, but then it stopped working. I started getting session start errors, then I added a php.ini file to turn off safe mode and now I can’t login.

        How do you manually reset the login permissions?
        • Sounds like this could have everything with PHP sessions. If PHP isn’t able to write sessions, then the manager may break -- Evo uses normal $_SESSION’s, which usually means PHP writes a session file somewhere on the file system.

          You could test this by making 2 php pages:

          <?php
          $_SESSION['testing'] = 'Remember me';
          ?>
          Page 1.
          


          And then another one like this:
          <?php
          print $_SESSION['testing'];
          ?>
          Page 2


          Then hit Page 1, then Page 2 in your browser -- if the value doesn’t persist, you know you have a problem with your sessions.
            • 14542
            • 13 Posts
            I just tested the session’s with you code and I didn’t get a return value. Just the Page 1 / Page 2 text underneath.

            So now I know there’s something wrong with my sessions, how can I fix it?
            • Bingo. Well... try un-doing what you changed in the php.ini file. Do you have a backup of the php.ini file? Or does your host have a default php.ini file you could use?
                • 3749
                • 24,544 Posts
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 14542
                  • 13 Posts
                  When I first installed Modx there was no php.ini file on my server, then I started getting session start errors so the host added one for me with;

                  safe_mode = off

                  Since then I have added a few more lines,

                  magic_quotes_gpc = off
                  date.timezone = "Australia/Melbourne"
                  memory_limit = 128M

                  If I take everything out of the php.ini file I get the following error.


                  Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 2197 is not allowed to access /tmp owned by uid 0 in /home/cremefre/public_html/manager/includes/config.inc.php on line 60

                  Fatal error: session_start() [<a href=’function.session-start’>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/cremefre/public_html/manager/includes/config.inc.php on line 60

                  I then added the following code to the php.ini file (thanks bob) and have also added to the ht.access file. But am waiting on the host to restart the server.

                  session.save_path = /home/cremefre/public_html/assets/sessions/
                  session.gc_maxlifetime = 28800

                  Which removes the session start errors, but I still have the same problem of not being able to login to the manager as the screen resets after I have clicked submit.
                  • It’s not possible for PHP to work without a php.ini file. When you use the phpinfo() function, it will tell you which php.ini file it is using for its settings, e.g.

                    <?php
                    phpinfo();
                    ?>


                    You can override settings from php.ini in various ways on some hosts. It sounds like the default php.ini file uses the safe mode, and your extension of the php.ini file is incomplete. You may need to override the "safe_mode" setting.

                    But on the whole, this is weird. Who is the host? And why would they have such a strangely configured php.ini file?
                    • Many shared hosts have that kind of php safe_mode setting. Unless they specifically allow access to the /tmp directory, since it’s outside of the web root where the script is being executed (the index.php file) it’s inaccessible.

                      Each directory that executes a .php script needs to have its own supplementary php.ini file to override the default settings in the main server php.ini file, unlike .htaccess these are not inherited. That means you’ll need one in the root (for the main site’s index.php) and one in /manager (for the manager’s index.php file).
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org