• ベストアンサー

「URL file-access is disabled in the server configuration ・・・」エラーが

こんばんは。  初歩的な質問で申し訳ないのですが教えてください。 現在、PHPでホームページを作成していて、ベースとなるページの モードはSSL(https)で作成しているのですが、そのページから参照される (require_onceにて)ファイルのページのモードは標準(http)にサイトに 設置されています。 しかし、SSL(https)から標準(http)のファイルにrequire_onceを行うと 「Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in ・・・」 と表示されてしまいます。 どのような対処をしたらよろしいでしょうか? 使っているレンタルサーバーは「WADAX(http://www.wadax.ne.jp/)」です。 お分かりの方は教えてください。

  • PHP
  • 回答数1
  • ありがとう数3

質問者が選んだベストアンサー

  • ベストアンサー
  • php504
  • ベストアンサー率42% (926/2160)
回答No.1

PHPにはURLも普通のファイルとして扱えるようにする機能(allow_url_fopen)がありますがそれがオフになっていて使えないのでしょう。 require_onceの内容をURLではなく普通のファイルにはできないのでしょうか。 サーバ内部処理での問題なのでSSLは関係ないと思います。

tdohmoto
質問者

補足

お返事ありがとうざいました。 今回、SSL(https)ページから標準(http)ページを参照したい理由として SSL(https)ページにてログインした情報をセッションにて維持しており、 そのセッション情報を標準(http)ページにも維持したいからでした。 SSL(https)ページにてログインした情報はSSL(https)ページ内で参照が 可能ですが、標準(http)ページになるとアドレスが変わってしまうため 参照が出来ませんでした。 何か良い他の方法はあるのでしょうか? 「goo」や「Yahoo!」はアドレスが変わってもログイン情報を 維持していますが、どのようにして行っているのでしょうか?

関連するQ&A

  • require_onceでファイルが開けない!?

    requre_onceでのファイルの読み込みが上手くいかないらしく、次のようなエラー文が出てしまい困っております。 =========エラー文=================== Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in C:\xampp\htdocs\wakuphp\girlup_result_kanryou.php on line 6 Warning: require_once(http://waku2work.com/mysql2.php) [function.require-once]: failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\wakuphp\girlup_result_kanryou.php on line 6 Fatal error: require_once() [function.require]: Failed opening required 'http://waku2work.com/mysql2.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\wakuphp\girlup_result_kanryou.php on line 6 ================================ 問題の6行目のソースコードは以下の通りです。 ======ソースコード6行目================= require_once("http://waku2work.com/mysql2.php"); ================================ この場合、”require_once”が読み込めて無いって事ですよね!? 一応初心者なのですが、気になるのは3つ目のエラー表示で、ローカルのパス表示が出てる点です。 設定がうまくいってないのでしょうか? 有識者の方いらっしゃいましたら、どうか宜しくお願いします!

    • ベストアンサー
    • PHP
  • PHP4で動作していた以下のソースが、PHP5にバージョンアップしたら

    PHP4で動作していた以下のソースが、PHP5にバージョンアップしたらエラーが出るようになってしまいました。 どのように修正したらよいかご教授ください。 サーバーはロリポップです。 ■ソース <?php header('Content-Type: text/html; charset=SHIFT_JIS'); require("http://別ドメイン/estate.html"); ?> ■エラー Warning: require() [function.require]: URL file-access is disabled in the server configuration in /パス/ファイル名 on line 3 Warning: require(取り込みたいファイルのパス/estate.html) [function.require]: failed to open stream: no suitable wrapper could be found in /パス/ファイル名 on line 3 Fatal error: require() [function.require]: Failed opening required 取り込みたいファイルのパス/estate.html' (include_path='.:/usr/local/php5.2/php') in /パス/ファイル名 on line 3

    • ベストアンサー
    • PHP
  • Server Error in '/' Appli

    以下のようなエラーがでてダウンロードができなくなり大変困っています 仕事で使用するため、あるサイトのデータをダウンロードしようとしたのですが 以下のようなエラーがでてくるようになってしまいダウンロードできなくなってしまいました 他の方の質問等を見て、インターネット一時ファイルやcookieを消去してみたりしましたがダメでした。 chrome、firefox、IE全て試しましたが全部駄目でした このエラーがでなくなり、ダウンロードが問題なくできるようになる方法を 御教授お願い致します Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off". <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL. <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>

  • 設定ファイルを覗かれないようにするには?

    誰でも設置できるようなフリーCGIを作っていて、ふと思ったのですが、設定ファイルを別ファイルにする場合、そのファイル名が一般に知られてしまうような場合だとincludeなどで読み込まれて設定が覗かれてしまうということはないのでしょうか。 ネットでさがしてみましたが、あまり情報がなく、自分でやってみたところ「file-access is disabled in the server configuration」と出ました。 includeなどは、絶対パスでは読み込めないのでしょうか。 また、共有サーバーなどで、相対パスで指定された場合はどうでしょうか。 よろしくお願いいたします。

    • ベストアンサー
    • PHP
  • XAMPPを導入した所、Warning: include() [function.include](以降省略)というエラーが出るようになりました。

    出るエラー内容は下記です。 Warning: include() [function.include]: URL file-access is disabled in the server configuration in (サイトアドレス)\index.php on line 44 そのためindex.phpの44行目を確認した所、該当部分で<?php include('ファイル名'); ?>と記述していました。 http://oshiete1.goo.ne.jp/qa3325620.htmlに似た質問がございますが、こちらのPHPのバージョンは5.2.4のため、あちらの解決法は適用できないと判断し質問いたしました。 他にもGoogleで検索し796件ヒットしたのですが、解決法が書いてあるわけではなく、実際に同じエラーが出ているような感じでした。 そのためこのWarningがでないようにする方法をご教授いただければと思います。

    • ベストアンサー
    • PHP
  • さくらのレンタルサーバーでDB.php読み込み失敗

    下記の環境でPHPを書いています。 ・さくらのレンタルサーバ スタンダード ・PHP 5.2.13 ・php.iniファイルパス /home/******/www/php.ini その中で、require_once("DB.php");と記述をしているのですが、 その部分で下記のエラーが発生します。 Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in /home/xxx/www/class/db.class on line 6 Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.:/usr/local/php/5.2.13/lib/php') in /home/xxx/www/class/db.class on line 6 2ヶ月ほど前に作成した時は間違いなく正常に動作していたのですが・・・。 久しぶりにアクセスしたらこんなエラーが出ていて途方にくれています。 推測できる原因はありますでしょうか?

    • ベストアンサー
    • PHP
  • サーバー上にディレクトリを作成したいがパーミッションエラー…。

    フォームに入力した情報をもとに、 サーバー上にディレクトリを作成したいのですが、 Warning: mkdir(作成したいディレクトリ名): Permission denied in ~ というエラーが出てしまい、ディレクトリを作成できません;; 原因はなんなんでしょうか? どうぞよろしくお願いします。

    • 締切済み
    • PHP
  • require_onceについて

    MAMPを使用して開発しています。 MAMP/htdocsに入っているa.phpから同一階層にあるb.phpを呼びだそうと思い require_once('b.php'); と記述したのですが Warning: require_once(b.php): failed to open stream: No such file or directory in - on line 13 Fatal error: require_once(): Failed opening required 'b.php' (include_path='.:') in - on line 13 とエラーが表示されます。色々と試してみたもののうまくいかず。 アドバイスを宜しくお願い致します。

    • ベストアンサー
    • PHP
  • サイトにアクセス出来なくなって困っています = Web.Config Server Error in '/' Application 

    いつも利用しているサイトを観覧中に、 「Server Error in '/' Application.」と書かれたエラーが発生してアクセス出来なくなりました。 パソコンやインターネットについて無知なため、エラー内容に書かれてある「Web.Config」という言葉も初めて見ました。ネットで検索して意味や原因を探してみたのですが、全く理解できなくて困っています。 どなたかお分かりになる方お願いします。 内容は以下です。 Server Error in '/' Application. -------------------------------------------------------------------------------- Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off". <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL. <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration> =========== どのような問題が発生してアクセス出来なくなっていますか? アクセスのための解決法はありますか? お願いいたします。

  • PHP requireでのURLパラメータ指定

    PHPにてアクセスカウンターを作っているのですが、呼び出したときのパラメータにて合計カウント数、本日のカウント数、昨日のカウント数のどれを表示するのか分けるプログラムを作成しました。 直接アドレスバーにて、 http://localhost/counter/count.php?mode=total とパラメータ指定したときにはきちんと表示出来るのですが、他のPHPファイルから require ("./count.php?mode=total"); で呼び出すと、 Warning: require(./count.php?mode=total) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\counter\index.php on line 7 Fatal error: require() [function.require]: Failed opening required './count.php?mode=total' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\counter\index.php on line 7 というエラーが出てしまいます。 色々調べたところ、相対パス指定のときにはパラメータ指定が出来ないという情報があったので、絶対パスで指定してみたのですが、やはり上手くいきません。 Warning: require() [function.require]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\counter\index.php on line 7 Warning: require(http://localhost/counter/count.php?mode=total) [function.require]: failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\counter\index.php on line 7 Fatal error: require() [function.require]: Failed opening required 'http://localhost/counter/count.php?mode=total' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\counter\index.php on line 7 というようにエラーが出てしまいます。 どのようにすれば上手く表示できるでしょうか? 是非回答よろしくお願い致します。

    • ベストアンサー
    • PHP

専門家に質問してみよう