We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20549
    • 29 Posts
    I really need help with this one. I moved my site from Bluehost to LiquidWeb and in so doing, was upgraded to PHP 5.3.14. Now that I have, the manager pages struggle to load correctly.

    My site works correctly and seemly has no issues, but the manager tends to return an Internal Server error message in either the header, doc tree or main body. Oddly, one or two of the three areas of the manager will load correctly while the other sections do not. When I refresh my browser (Mac, Safari 6.0, Chrome V21.0.1180) I'll see elements of my public side website load in the header, doc tree or main body. After two to five refreshes, I'll get the manager to fully load.

    On occasion, I'll see these errors in the three areas of the manager:

    Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/spfishmg/public_html/manager/includes/user_settings.inc.php on line 18

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/spfishmg/public_html/manager/includes/user_settings.inc.php on line 20

    Warning: Cannot modify header information - headers already sent by (output started at /home/spfishmg/public_html/manager/includes/user_settings.inc.php:18 ) in /home/spfishmg/public_html/manager/index.php on line 150

    Any suggestions for the fix would be greatly appreciated. I don't want to have to downgrade php versions if I can avoid it.

    www.sanpedrofish.com - my first adaptive layout!


    MySQL:
    Server: Localhost via UNIX socket
    Server version: 5.1.63
    Protocol version: 10
    User: spfishmg@localhost
    MySQL charset: UTF-8 Unicode (utf8 )

    webserver:
    cpsrvd 11.30.7.2
    MySQL client version: 4.1.22
    PHP extension: mysql
    [ed. note: mtbinary last edited this post 14 years, 1 month ago.]
      • 16278
      • 928 Posts
      Possibly this is caused by the same thing as hit me when I tried out PHP 5.4 (using EasyPHP as a temporary install on my Windows PC).

      The API database escape function in /manager/includes/extenders/dbapi.mysql.class.inc.php features the old mysql_escape_string() function. This leads to a "deprecated" error even though it's not going to be used. The function has been deprecated since PHP 5.3.0. And given that mysql_real_escape_string() has been available since PHP version 4.3.0 (before the minimum MODX Evo requirement version 4.3.11), there's no need for the old version to be there at all.

      I got MODX 1.0.6 running by commenting out line 123 in this file. I think the "output started" may be down to the "deprecated" error message having been output.
         function escape($s) {
            if (function_exists('mysql_real_escape_string') && $this->conn) {
               $s = mysql_real_escape_string($s, $this->conn);
            } else {
      ////////////////////// comment me out!         $s = mysql_escape_string($s); ///////////////////////
            }
            return $s;
         }
      


      :) KP

      P.S. do you really want to expose all that server info from phpinfo() to the world at large? [ed. note: kp52 last edited this post 14 years, 1 month ago.]
        • 20549
        • 29 Posts
        Hi KP. No, I didn't want that php exposed for any longer than finding help for this issue. But desperation causes people like me to take a temporary risk! At this point, I will be forced to change servers if I can't fix it.

        I'll try this. Thank you.
          • 20549
          • 29 Posts
          Hello again -

          KP, the fix above is a much better fix for the escape slashes problem I had with this new server.

          Unfortunately, my original problem has not gone away.

          This is a typical display:








          [ed. note: mtbinary last edited this post 14 years, 1 month ago.]
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The parts where the home page is showing is because the individual frames are causing a 404 error, which MODx will load with your "not found" error page (probably your home page). As to why it's doing the 404 thing with the frames, I don't know.
              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