We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20644
    • 37 Posts
    SMFssiを表示しているページでWebLoginを使ってログイン、ログアウトすると
    ( [[WebLogin?&tpl=`WebLoginSideBar` &logintext=`ログイン` &logouttext=`ログアウト`]] として呼び出しています)
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	main(/QueryString.php) [function.main]: failed to open stream: No such file or directory	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/var/www/*****/smf/SSI.php	 
      Line: 	56	 
      Line 56 source: 	require_once($sourcedir . '/QueryString.php');

    という風にエラーが出ます。
    そのままだと表示が切り替わらないので、
    とりあえず、使用するには問題ないように、weblogin.processor.inc.phpの
    $modx->sendRedirectを$modx->sendRedirect($url,1)としました。

    問題の根本的原因がわからず困っています。

    環境は、大学内のウェブホスティングで
    FreeBSD 5.2.1-RELEASE-p13
    Apache/2.0.52
    PHP 4.4.6
    MySQL 4.1.13
    MODx 0.9.5
    です。

    どなたかこの原因がわかる方いらっしゃらないでしょうか?
    なんとなく、Webloginのリダイレクトが悪さをしているような気がするのですが・・・・
      • 33488
      • 429 Posts
      ソースも見てないのでいい加減ですけど、エラーからするとあるべきファイルがオープンできない・・ってことなので
      どこかで、カレントディレクトリが変わっている??のか、SSI.phpのmain(/QueryString.php)の部分のQueryStringの/がそもそも呼び出しがまずいとかでは??
      その部分がどういう記述なのかは定かではありませんが、/はまずいんではないかと思います。



        • 20644
        • 37 Posts
        >Zeroさん
        レスありがとうございます  :)

        SSI.phpのソースですが、
        // We're going to want a few globals... these are all set later.
        global $time_start, $maintenance, $msubject, $mmessage, $mbname, $language;
        global $boardurl, $boarddir, $sourcedir, $webmaster_email, $cookiename;
        global $db_server, $db_name, $db_user, $db_prefix, $db_persist, $db_error_send, $db_la
        st_error;
        global $db_connection, $modSettings, $context, $sc, $user_info, $topic, $board, $txt;
        
        // Remember the current configuration so it can be set back.
        $ssi_magic_quotes_runtime = get_magic_quotes_runtime();
        @set_magic_quotes_runtime(0);
        $time_start = microtime();
        
        // Get the forum's settings for database and file paths.
        require_once(dirname(__FILE__) . '/Settings.php');
        $ssi_error_reporting = error_reporting(E_ALL);
        // Don't do john didley if the forum's been shut down competely.
        if ($maintenance == 2 && (!isset($ssi_maintenance_off) || $ssi_maintenance_off !== tru
        e))
                die($mmessage);
        
        // Fix for using the current directory as a path.
        if (substr($sourcedir, 0, 1) == '.' && substr($sourcedir, 1, 1) != '.')
                $sourcedir = dirname(__FILE__) . substr($sourcedir, 1);
        
        // Load the important includes.
        require_once($sourcedir . '/QueryString.php');
        require_once($sourcedir . '/Subs.php');
        require_once($sourcedir . '/Errors.php');
        require_once($sourcedir . '/Load.php');
        require_once($sourcedir . '/Security.php');


        となっています。
        実は先ほど、$sourcedirやその他のデータベースの設定値をSetting.phpから読み出している部分の
        require_once(dirname(__FILE__) . ’/Settings.php’);
        を
        require(dirname(__FILE__) . ’/Settings.php’);
        としましたら、とりあえずエラーが消えてしまいました shocked
        phpをキチンと理解していないのですが、require_onceは既にコードが読み込まれていれば実行しないということですよね。
        SSI.phpを読み出している、スニペットSMFssi側では、Setting.phpを読み出していないので、SSI.phpを実行した時に、初めて Setting.phpが読み込まれていると思うので、なぜこうなるのか不思議です。
        リダイレクト(というか同じページに飛ぶのでリフレッシュ)でごく短時間に繰り返し実行されて、おかしくなるということってないでしょうか・・・・ huh



          • 33488
          • 429 Posts
          不思議ですねぇ・・・・get_included_files() でチェックしてみるとか・・・

          実際の動作は、私も詳しくはないんですけど・・・ファイル名またはファイルパスで読み込んでるかチェックしているんではと思うのですが、バグっていう可能性もなきにしもあらず。
          sourcedirが設定されてない状態でrequireされたっていうことですねぇ。

          確かに不思議です。