PHPインクルード・エラー表示
ファイルをインクルードして表示させようとしたら以下のような表示が出てしまいました。
Warning: include() [function.include]: Unable to access /virtual/ID/public_html/wwwドメイン名/include/index.php in /virtual/ID/public_html/www.ドメイン名/index.php on line 65
Warning: include(/virtual/ID/public_html/www.ドメイン名/include/index.php) [function.include]: failed to open stream: No such file or directory in /virtual/ID/public_html/www.ドメイン名/index.php on line 65
Warning: include() [function.include]: Failed opening '/virtual/ID/public_html/www.ドメイン名/include/index.php' for inclusion (include_path='.:/usr/local/lib/php') in /virtual/ID/public_html/www.ドメイン名/index.php on line 65
初期に契約したサーバーでは問題なく表示されていたのに...。
ですので記述方法が間違っている可能性は低いと思い込んでしまい解決までに結構時間を要してしまいました。
判明した原因は、インクルードするファイルへのパスをURLで指定していたことにありました。
Movable Type4.1での利用だったので、<$MTBlogURL$>を<$MTBlogSitePath$>に変更したらエラー表示されなくなりました。
Coreサーバのウェブサイトを確認
標準で、include()/require()によるURLの取得ができなくなっております。
おすすめいたしませんが、ご利用いただくには、下記コマンドを「.htaccess」に記載してください。
php_flag allow_url_fopen on
php_flag allow_url_include on
カテゴリー:COREサーバー
