teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2019/02/26 08:26

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -37,6 +37,6 @@
37
37
  のように試しにディレクトリを include させてみたところ、
38
38
 
39
39
  > include_once(/var/www/example.jp/wp-content/themes/twentyseventeen-child/css/): failed to open stream: No such file or directory in /var/www/example.jp/wp-content/themes/twentyseventeen-child/page-xxx.php on line 29
40
- > include_once(): Failed opening '/home/studiocue/ExampleJP/www1.example.jp/wp-content/themes/twentyseventeen-child/css/' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/example.jp/wp-content/themes/twentyseventeen-child/page-xxx.php on line 29
40
+ > include_once(): Failed opening '/var/www/example.jp/wp-content/themes/twentyseventeen-child/css/' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/example.jp/wp-content/themes/twentyseventeen-child/page-xxx.php on line 29
41
41
 
42
42
  というエラーになりました。

1

追記

2019/02/26 08:26

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -11,4 +11,32 @@
11
11
  Warning: include_once(http://~): failed to open stream: no suitable wrapper could be found in ~
12
12
  Warning: include_once(): Failed opening 'http://~' for inclusion (include_path='.:/opt/php-7.2.6/data/pear') in
13
13
 
14
- [allow_url_include](http://php.net/manual/ja/filesystem.configuration.php#ini.allow-url-include) が、 0 (OFF) になっているというメッセージなので、php.ini 等で、 allow_url_include を有効に設定してください。
14
+ [allow_url_include](http://php.net/manual/ja/filesystem.configuration.php#ini.allow-url-include) が、 0 (OFF) になっているというメッセージなので、php.ini 等で、 allow_url_include を有効に設定してください。
15
+
16
+ ----
17
+
18
+ 追記を受けて...
19
+
20
+ > 明記したコードは下記の通りになります。
21
+ > <?php
22
+ > include_once(TEMPLATEPATH.'/calendar2/');
23
+ > ?>
24
+
25
+ まず、include_once は、`実在するファイル`しか読み込めません。
26
+
27
+ TEMPLATEPATH は、通常、テンプレートディレクトリのファイルパスが定義されているので、`/var/www/example.jp/wp-content/themes/twentyseventeen-child` のような感じになると思うのですが...
28
+
29
+ 試しに、wordpress の twentyseventeen の子テーマで page-xxx.php を作成して、
30
+
31
+ ```
32
+ <?php
33
+ echo "TEMPLATEPATH";
34
+ include_once(TEMPLATEPATH.'/css/');
35
+ ?>
36
+ ```
37
+ のように試しにディレクトリを include させてみたところ、
38
+
39
+ > include_once(/var/www/example.jp/wp-content/themes/twentyseventeen-child/css/): failed to open stream: No such file or directory in /var/www/example.jp/wp-content/themes/twentyseventeen-child/page-xxx.php on line 29
40
+ > include_once(): Failed opening '/home/studiocue/ExampleJP/www1.example.jp/wp-content/themes/twentyseventeen-child/css/' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/example.jp/wp-content/themes/twentyseventeen-child/page-xxx.php on line 29
41
+
42
+ というエラーになりました。