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

質問編集履歴

3

追記しました。

2019/10/25 10:10

投稿

gunmed
gunmed

スコア55

title CHANGED
File without changes
body CHANGED
@@ -81,6 +81,8 @@
81
81
 
82
82
 
83
83
  その後にphp -vをするとphp 5.3.3がインストールされたみたいなので、php_lessonsに移動し、php -S 192.168.33.10:8000を行うと以下のようになりましたが、http://http://192.168.33.10:8000/としても、「サイトにアクセスできません」となりました。
84
+
85
+
84
86
  ```
85
87
  [vagrant@localhost php_lessons]$ php -v
86
88
  PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)

2

追記しました。

2019/10/25 10:10

投稿

gunmed
gunmed

スコア55

title CHANGED
File without changes
body CHANGED
@@ -124,16 +124,4 @@
124
124
  --rc <name> Show information about class <name>.
125
125
  --re <name> Show information about extension <name>.
126
126
  --ri <name> Show configuration for extension <name>.
127
- ```
127
+ ```
128
-
129
- そして、[VagrantでPHPの開発環境を作ってみる](https://qiita.com/AkihikoIkeda/items/6e886f74a934e0ddfcab)というQiitaのサイトを参考に以下のコマンドをそれぞれ入力しました。
130
-
131
- ```terminal
132
- sudo yum -y install epel-release
133
- sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
134
- sudo yum -y install --enablerepo=remi,remi-php71 php php-devel php-mbstring php-pdo php-gd ph
135
- ```
136
-
137
- その結果が以下です。requested datatype primary not availableという同じエラーがでてしまいました、。
138
-
139
- ![イメージ説明](40a9fa8d6a0e9ae664d7e058253aeecc.png)

1

さらに行ったことを記入しました。

2019/10/25 10:00

投稿

gunmed
gunmed

スコア55

title CHANGED
File without changes
body CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  exec $SHELL -l
29
29
  ```
30
- ⑤cyberduckをインストールし、新規接続SFTPで接続し、php_lessonsというフォルダを作成し、phpのファイルを作成
30
+ ⑤cyberduckをインストールし、新規接続SFTPで接続し、php_lessonsというフォルダを作成し、phpのファイルを作成し、<?php echo "hello!"; ?>と記述。
31
31
 
32
32
  ⑥ターミナル上で、[vagrant@localhost ~]$から、php_lessonsに移動して、php -S 192.168.33.10:8000を入力すると、
33
33
 
@@ -50,85 +50,90 @@
50
50
  というterataiのサイトを参考に、./run.shのセットアップが失敗している可能性があるとわかったので、その結果を見てみると、異常のある部分がありました。
51
51
  requested datatype primary not availableというエラーが最後尾あたりにあります。
52
52
 
53
- ```terminal
54
- [vagrant@localhost centos6]$ ./run.sh
53
+ ![イメージ説明](43b91a95564b28b30bbf63e0b5d848b4.png)
55
- 読み込んだプラグイン:fastestmirror
56
- 更新処理の設定をしています
57
- Loading mirror speeds from cached hostfile
58
- * base: ftp.tsukuba.wide.ad.jp
59
- * epel: my.fedora.ipserverone.com
60
- * extras: ftp.tsukuba.wide.ad.jp
61
- * remi-safe: mirror.team-cymru.com
62
- * updates: ftp.tsukuba.wide.ad.jp
63
- 更新と設定されたパッケージがありません。
64
54
 
65
- PLAY [localhost] *****************************************************************************************************************************************************************************************************************************
55
+ いろいろ調べてみて、出現してるエラーの表示は異なるのですが、teratailの[ドットインストール第6回,Vagrant で./run.shを実行しても何もインストールされてない](https://teratail.com/questions/44483)の回答を参考に[vagrant@localhost centos6]において
56
+ ```
57
+ $ ls -l /etc/ansible/hosts
58
+ -rw-r--r--. 1 root root 1026 Aug 16 17:46 /etc/ansible/hosts
59
+ $ sudo bash -c "echo 127.0.0.1 >> /etc/ansible/hosts"
60
+ $ ./run.sh
61
+ ```
62
+ を実行するも、エラーは結局変わらず。
66
63
 
67
- TASK [Gathering Facts] ***********************************************************************************************************************************************************************************************************************
68
- ok: [127.0.0.1]
64
+ requested datatype primary not availableの対処法がいくら探しても見当たらず。時間もかなりかかってしまったので、ここに質問させていただきました。
65
+ vagrantなどの知識が欠如しており、自分だけでの解決は厳しいので、回答していただけると幸いです。
66
+ また、足りない情報があれば、教えてください。
67
+ よろしくお願いいたします。
69
68
 
70
- TASK [disable iptables] **********************************************************************************************************************************************************************************************************************
71
- ok: [127.0.0.1]
69
+ mac 10.14.6
70
+ vagrant 2.2.6
72
71
 
73
- TASK [install libselinux-python] *************************************************************************************************************************************************************************************************************
74
- ok: [127.0.0.1]
72
+ # 質問後にやってみたこと
73
+ $ sudo yum install php
74
+ $ sudo yum install httpd
75
+ をまず行ってみました。すると以下のようなものが表示されました。
75
76
 
76
- TASK [Disabled SELinux] **********************************************************************************************************************************************************************************************************************
77
- [WARNING]: SELinux state change will take effect next reboot
77
+ ![イメージ説明](fe9ac474cfc3ed2f440814b0a3448294.png)
78
78
 
79
- ok: [127.0.0.1]
79
+ ![イメージ説明](103fd71a518c25361d19d40e3a4ca51f.png)
80
80
 
81
- TASK [remove localtime] **********************************************************************************************************************************************************************************************************************
82
- changed: [127.0.0.1]
83
81
 
84
- TASK [change timezone] ***********************************************************************************************************************************************************************************************************************
85
- changed: [127.0.0.1]
86
82
 
87
- TASK [change locale] *************************************************************************************************************************************************************************************************************************
88
- ok: [127.0.0.1]
83
+ その後にphp -vをするとphp 5.3.3がインストールされたみたいなので、php_lessonsに移動し、php -S 192.168.33.10:8000を行うと以下のようになりましたが、http://http://192.168.33.10:8000/としても、「サイトにアクセスできません」となりました。
84
+ ```
85
+ [vagrant@localhost php_lessons]$ php -v
86
+ PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
87
+ Copyright (c) 1997-2010 The PHP Group
88
+ Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
89
+ [vagrant@localhost php_lessons]$ php -S 192.168.33.10:8000
90
+ Usage: php [options] [-f] <file> [--] [args...]
91
+ php [options] -r <code> [--] [args...]
92
+ php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
93
+ php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
94
+ php [options] -- [args...]
95
+ php [options] -a
89
96
 
90
- TASK [install remi repository] ***************************************************************************************************************************************************************************************************************
91
- [WARNING]: Consider using the yum, dnf or zypper module rather than running rpm. If you need to use command because yum, dnf or zypper is insufficient you can add warn=False to this command task or set command_warnings=False in
92
- ansible.cfg to get rid of this message.
97
+ -a Run as interactive shell
98
+ -c <path>|<file> Look for php.ini file in this directory
99
+ -n No php.ini file will be used
100
+ -d foo[=bar] Define INI entry foo with value 'bar'
101
+ -e Generate extended information for debugger/profiler
102
+ -f <file> Parse and execute <file>.
103
+ -h This help
104
+ -i PHP information
105
+ -l Syntax check only (lint)
106
+ -m Show compiled in modules
107
+ -r <code> Run PHP <code> without using script tags <?..?>
108
+ -B <begin_code> Run PHP <begin_code> before processing input lines
109
+ -R <code> Run PHP <code> for every input line
110
+ -F <file> Parse and execute <file> for every input line
111
+ -E <end_code> Run PHP <end_code> after processing all input lines
112
+ -H Hide any passed arguments from external tools.
113
+ -s Output HTML syntax highlighted source.
114
+ -v Version number
115
+ -w Output source with stripped comments and whitespace.
116
+ -z <file> Load Zend extension <file>.
93
117
 
118
+ args... Arguments passed to script. Use -- args when first argument
94
- changed: [127.0.0.1]
119
+ starts with - or script is read from stdin
95
120
 
96
- TASK [install man] ***************************************************************************************************************************************************************************************************************************
97
- ok: [127.0.0.1]
121
+ --ini Show configuration file names
98
122
 
99
- TASK [install apache] ************************************************************************************************************************************************************************************************************************
100
- ok: [127.0.0.1]
123
+ --rf <name> Show information about function <name>.
124
+ --rc <name> Show information about class <name>.
125
+ --re <name> Show information about extension <name>.
126
+ --ri <name> Show configuration for extension <name>.
127
+ ```
101
128
 
102
- TASK [start apache and enabled] **************************************************************************************************************************************************************************************************************
103
- ok: [127.0.0.1]
129
+ そして、[VagrantでPHPの開発環境を作ってみる](https://qiita.com/AkihikoIkeda/items/6e886f74a934e0ddfcab)というQiitaのサイトを参考に以下のコマンドをそれぞれ入力しました。
104
130
 
105
- TASK [change owner] **************************************************************************************************************************************************************************************************************************
106
- ok: [127.0.0.1]
107
-
108
- TASK [copy httpd.conf] ***********************************************************************************************************************************************************************************************************************
109
- ok: [127.0.0.1]
110
-
111
- TASK [install gd-last] ***********************************************************************************************************************************************************************************************************************
112
- fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "エラー: requested datatype primary not available\n", "rc": 1, "results": []}
113
- to retry, use: --limit @/home/vagrant/centos6/main.retry
114
-
115
- PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
116
- 127.0.0.1 : ok=13 changed=3 unreachable=0 failed=1
131
+ ```terminal
132
+ sudo yum -y install epel-release
133
+ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
134
+ sudo yum -y install --enablerepo=remi,remi-php71 php php-devel php-mbstring php-pdo php-gd ph
117
135
  ```
118
136
 
119
- いろいろ調べてみて、出現してるエラーの表示は異なるのですが、teratailの[ドットインストール第6回,Vagrant で./run.shを実行しても何もインストールされてない](https://teratail.com/questions/44483)の回答を参考に[vagrant@localhost centos6]において
120
- ```
121
- $ ls -l /etc/ansible/hosts
122
- -rw-r--r--. 1 root root 1026 Aug 16 17:46 /etc/ansible/hosts
123
- $ sudo bash -c "echo 127.0.0.1 >> /etc/ansible/hosts"
137
+ その結果が以下です。requested datatype primary not availableという同じエラーがでてしまいました、。
124
- $ ./run.sh
125
- ```
126
- を実行するも、エラーは結局変わらず。
127
138
 
128
- requested datatype primary not availableの対処法がいくら探しても見当たらず。時間もかなりかかってしまったので、ここに質問させていただきました。
129
- vagrantなどの知識が欠如しており、自分だけでの解決は厳しいので、回答していただけると幸いです。
139
+ ![イメージ説明](40a9fa8d6a0e9ae664d7e058253aeecc.png)
130
- また、足りない情報があれば、教えてください。
131
- よろしくお願いいたします。
132
-
133
- mac 10.14.6
134
- vagrant 2.2.6