現在
www(root)に静的なページを構築しております。
現在一部のディレクト配下のhtmlにphpを使用したく、そのディレクリに
.htaccessを設置・使用し下記のように記載しております。
ページを開くと
Warning: include(/virtual/www/common/include/header1.html): failed to open stream: No such file or directory in E:\WORK****\www*****\index.html on line 39
のように表示されてしまいます。
大変恐縮ではございますがご教示いただければ幸いです。
さくらの共用サーバー上では問題なくinckudeできております。
phpのバージョンは7です。
html
1echo "Hello World"; 2phpinfo();
エラーの出るindex.htmlには上記どちらも表示されました。
index.htmlには下記の記載をしました。
html
1<?php include('/virtual/www/common/include/header1.html'); ?>
.htaccess
AddType application/x-httpd-php .html
xamppのApacheの設定には
httpd.conf
httpd.conf
1# 2# This is the main Apache HTTP server configuration file. It contains the 3# configuration directives that give the server its instructions. 4# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. 5# 文字数制限の為一部説明コメント省略 6 7ServerRoot "E:/xampp/apache" 8 9# 10# Mutex: Allows you to set the mutex mechanism and mutex file directory 11# 文字数制限の為一部コメント省略 12# 13# Mutex default:logs 14 15# 16# 文字数制限の為一部説明コメント省略 17# 18#Listen 12.34.56.78:80 19Listen 80 20 21# 22# Dynamic Shared Object (DSO) Support 23# 24# 文字数制限の為一部説明コメント省略 25# 26# Example: 27# LoadModule foo_module modules/mod_foo.so 28# 29LoadModule access_compat_module modules/mod_access_compat.so 30LoadModule actions_module modules/mod_actions.so 31LoadModule alias_module modules/mod_alias.so 32LoadModule allowmethods_module modules/mod_allowmethods.so 33LoadModule asis_module modules/mod_asis.so 34LoadModule auth_basic_module modules/mod_auth_basic.so 35LoadModule authn_core_module modules/mod_authn_core.so 36LoadModule authn_file_module modules/mod_authn_file.so 37LoadModule authz_core_module modules/mod_authz_core.so 38LoadModule authz_groupfile_module modules/mod_authz_groupfile.so 39LoadModule authz_host_module modules/mod_authz_host.so 40LoadModule authz_user_module modules/mod_authz_user.so 41LoadModule autoindex_module modules/mod_autoindex.so 42LoadModule cgi_module modules/mod_cgi.so 43LoadModule dav_lock_module modules/mod_dav_lock.so 44LoadModule dir_module modules/mod_dir.so 45LoadModule env_module modules/mod_env.so 46LoadModule headers_module modules/mod_headers.so 47LoadModule include_module modules/mod_include.so 48LoadModule info_module modules/mod_info.so 49LoadModule isapi_module modules/mod_isapi.so 50LoadModule log_config_module modules/mod_log_config.so 51LoadModule cache_disk_module modules/mod_cache_disk.so 52LoadModule mime_module modules/mod_mime.so 53LoadModule negotiation_module modules/mod_negotiation.so 54LoadModule proxy_module modules/mod_proxy.so 55LoadModule proxy_ajp_module modules/mod_proxy_ajp.so 56LoadModule rewrite_module modules/mod_rewrite.so 57LoadModule setenvif_module modules/mod_setenvif.so 58LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 59LoadModule ssl_module modules/mod_ssl.so 60LoadModule status_module modules/mod_status.so 61LoadModule version_module modules/mod_version.so 62 63<IfModule unixd_module> 64# 65# If you wish httpd to run as a different user or group, you must run 66# 文字数制限の為一部説明コメント省略 67# running httpd, as with most system services. 68# 69User daemon 70Group daemon 71 72</IfModule> 73ServerAdmin postmaster@localhost 74 75ServerName localhost:80 76 77<Directory /> 78 AllowOverride All 79 Require all granted 80</Directory> 81 82DocumentRoot "E:\WORK****\www" 83<Directory "E:\WORK****\www"> 84 Options Indexes FollowSymLinks Includes ExecCGI 85 AllowOverride All 86 Require all granted 87</Directory> 88 89<IfModule dir_module> 90 DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \ 91 default.php default.pl default.cgi default.asp default.shtml default.html default.htm \ 92 home.php home.pl home.cgi home.asp home.shtml home.html home.htm 93</IfModule> 94 95<Files ".ht*"> 96 97</Files> 98 99ErrorLog "logs/error.log" 100 101LogLevel warn 102 103<IfModule log_config_module> 104 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 105 LogFormat "%h %l %u %t \"%r\" %>s %b" common 106 107 <IfModule logio_module> 108 # You need to enable mod_logio.c to use %I and %O 109 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 110 </IfModule> 111 112 CustomLog "logs/access.log" combined 113</IfModule> 114 115<IfModule alias_module> 116 # 117 # Redirect: Allows you to tell clients about documents that used to 118 # exist in your server's namespace, but do not anymore. The client 119 # will make a new request for the document at its new location. 120 # Example: 121 # Redirect permanent /foo http://www.example.com/bar 122 123 # 124 # Alias: Maps web paths into filesystem paths and is used to 125 # 文字数制限の為一部コメント省略 126 # client. The same rules about trailing "/" apply to ScriptAlias 127 # directives as to Alias. 128 # 129 ScriptAlias /cgi-bin/ "E:/xampp/cgi-bin/" 130 ScriptAlias /cgi-data/ "E:\WORK*****\cgi-data" 131 132</IfModule> 133 134<IfModule cgid_module> 135 # 136 # ScriptSock: On threaded servers, designate the path to the UNIX 137 # socket used to communicate with the CGI daemon of mod_cgid. 138 # 139 #Scriptsock cgisock 140</IfModule> 141 142# 143# "E:/xampp/cgi-bin" should be changed to whatever your ScriptAliased 144# CGI directory exists, if you have that configured. 145# 146<Directory "E:/xampp/cgi-bin"> 147 AllowOverride All 148 Options None 149 Require all granted 150</Directory> 151 152<IfModule headers_module> 153 RequestHeader unset Proxy early 154</IfModule> 155 156<IfModule mime_module> 157 TypesConfig conf/mime.types 158 AddType application/x-compress .Z 159 AddType application/x-gzip .gz .tgz 160 AddHandler cgi-script .cgi .pl .asp 161 AddType text/html .shtml 162 AddOutputFilter INCLUDES .shtml .html 163</IfModule> 164 165<IfModule mime_magic_module> 166 MIMEMagicFile "conf/magic" 167</IfModule> 168 169Include conf/extra/httpd-mpm.conf 170 171# Multi-language error messages 172Include conf/extra/httpd-multilang-errordoc.conf 173 174# Fancy directory listings 175Include conf/extra/httpd-autoindex.conf 176 177# Language settings 178Include conf/extra/httpd-languages.conf 179 180# User home directories 181Include conf/extra/httpd-userdir.conf 182 183# Real-time info on requests and configuration 184Include conf/extra/httpd-info.conf 185 186# Virtual hosts 187Include conf/extra/httpd-vhosts.conf 188 189# Local access to the Apache HTTP Server Manual 190#Include conf/extra/httpd-manual.conf 191 192# Distributed authoring and versioning (WebDAV) 193#Attention! WEB_DAV is a security risk without a new userspecific configuration for a secure authentifcation 194#Include conf/extra/httpd-dav.conf 195 196# Various default settings 197#Include conf/extra/httpd-default.conf 198# Implements a proxy/gateway for Apache. 199Include "conf/extra/httpd-proxy.conf" 200# Various default settings 201Include "conf/extra/httpd-default.conf" 202# XAMPP settings 203Include "conf/extra/httpd-xampp.conf" 204 205# Configure mod_proxy_html to understand HTML4/XHTML1 206<IfModule proxy_html_module> 207Include conf/extra/proxy-html.conf 208</IfModule> 209 210# Secure (SSL/TLS) connections 211Include conf/extra/httpd-ssl.conf 212# 213# Note: The following must must be present to support 214# starting without SSL on platforms with no /dev/random equivalent 215# but a statically compiled-in mod_ssl. 216# 217<IfModule ssl_module> 218SSLRandomSeed startup builtin 219SSLRandomSeed connect builtin 220</IfModule> 221 222# XAMPP: We disable operating system specific optimizations for a listening 223# socket by the http protocol here. IE 64 bit make problems without this. 224 225AcceptFilter http none 226AcceptFilter https none 227# AJP13 <IfModule mime_module>Proxy 228<IfModule mod_proxy.c> 229<IfModule mod_proxy_ajp.c> 230Include "conf/extra/httpd-ajp.conf" 231</IfModule> 232</IfModule>