Answers.Body: <p>Check that you've followed this instruction?</p>
  
  <blockquote>
    <p>Note: Please add this line to the httpd.conf or apache2.conf:</p>
  </blockquote>
  
  <pre><code>Include /root/.amp/apache.d/*.conf
  </code></pre>
  
  <p>To do this, edit your Apache configuration (on Debian I'd create <code>/etc/apache2/conf.d/civicrm-buildkit.conf</code>) and add that line.</p>
  
  <hr>
  
  <p>Check that you can open <code>http://localhost:7979</code> (or the URL reported by your <code>amp test</code>) from the machine you're working on (<code>curl http://localhost:7979/index.php</code> etc).</p>
  
  <ul>
  <li>A DNS failure suggests that your machine cannot resolve <code>localhost</code> - check <code>/etc/hosts</code> is correctly configured.</li>
  <li>A connection failure suggests Apache configuration - check that Apache is seeing the configuration and able to bind to appropriate ports.</li>
  <li>Errors in the output from curl, and further information in Apache / PHP error logs should give further information about what needs fixing.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T10:15:24.683Z
Answers.Text: @OregonJohn you had any luck with this issue?
Answers.UserDisplayName: Dilip Raj Baral
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-07T18:23:19.183Z
Answers.Text: I gave up on the buildkit process, and that is so long ago that I fail to remember even why I was exploring it. If might be a good idea if you make a new question to fit  your situation. I did find that doing my experiments in a virtualbox was immensely help full ... I must have a good twenty virtualbox copies now, even after thinning them down. Hope this helps in some way.
Answers.UserDisplayName: OregonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T22:41:33.727Z
Answers.Text: I had put that line in.
  
  Since the error report stated "file_get_contents(http://localhost:7979/index.php): failed to open" I thought I'd check info on that port. Here's what I got:
  
  Mint17a tech #  netstat -tulpn | grep :7979
  tcp6       0      0 :::7979                 :::*                    LISTEN      25242/apache2 
  
  Does that help you?
  
  Yes, I did restart apache2 many times
Answers.UserDisplayName: OregonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T22:42:07.430Z
Answers.Text: And restarted apache? (Can't tell from formatting if the inclusion happened before `service apache2 restart`)
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T23:08:39.323Z
Answers.Text: I cleared the logs at /var/log/apache2 and then retried amp test. I then checked the logs and all three (access.log, error.log, other_vhosts_access.log) were empty of any reports.
Answers.UserDisplayName: OregonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T23:37:00.560Z
Answers.Text: What do you see at http://localhost:7979/index.php when you do that? Could it be that `/etc/hosts` is missing localhost, so http://localhost doesn't resolve?
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T23:40:59.563Z
Answers.Text: Sorry, failed to follow directions carefully: localhost:7070/index.php resulted in the following access log entry:127.0.0.1 - - [18/May/2015:16:37:46 -0700] "GET /favicon.ico HTTP/1.1" 404 499 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0". There is no enty in error.log
Answers.UserDisplayName: OregonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T23:46:26.197Z
Answers.Text: See updated answer? I think you're not seeing the whole story there; if you got a 404 for favicon.ico I'd expect to also see an entry for the preceding request. You spotted the 7979 vs 7070 in previous reply, right?
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-19T00:10:26.533Z
Answers.Text: Firefox can't establish a connection to the server at localhost:7070. I am rebuilding my virtualbox with Linux Mint 17.1 from scratch just to be sure there is nothing wrong there. Since stackexchange is suggesting move this to chat I'll try that when I'm done with the fresh install. Thank you.
Answers.UserDisplayName: OregonJohn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-17T22:44:57.263Z
Answers.LastActivityDate: 2015-05-18T23:48:35.203Z
Answers.LastEditDate: 2015-05-18T23:48:35.203Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>Sorry to bump into an older post, I just wanted to share my experience while setting up CiviCRM development. So I already have an up and running instance of Civi drupal-demo site (which I did setup up an year ago) but recently I was again setting up development environment on other machine.</p>
  
  <p>All the steps worked pretty well till <code>amp test</code>. Again I experienced the same PHP warnings while performing this test as OregonJohn as specified here above.</p>
  
  <p>So to overcome this, I added specific permissions to the directory of buildkit in apache2.conf (in my case it is /opt/buildkit). Then I sudo chmod permissions to the directory.
  Here is the code I added in apache2.conf :</p>
  
  <pre><code>&lt;Directory /opt/buildkit&gt;
          Options Indexes FollowSymLinks
          AllowOverride None
          Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Or you can add your root directory with more configuration if it doesn't work (not recommended).</p>
  
  <pre><code>&lt;Directory /&gt;
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
      Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Hope it helps new upcoming Civi developers.</p>
  
  <p>Thank you.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-15T10:05:40.383Z
Answers.LastActivityDate: 2016-04-15T10:05:40.383Z
Answers.UserDisplayName: Anudit Verma
Answers.Body: <p>I had the same problem and the issue was that my web server is Apache 2.4 and  I had set the httpd_type to "apache" instead of "apache24" when running amp config. </p>
  
  <p>I solved the issue by giving  chmod permissions to buildkit and .amp directories and setting httpd_type to "apache24"</p>
  
  <p>More info <a href="https://github.com/civicrm/civicrm-buildkit/issues/122#issuecomment-68739172" rel="nofollow noreferrer">here</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-10T10:53:57.447Z
Answers.LastActivityDate: 2018-07-10T10:53:57.447Z
Answers.UserDisplayName: Aswani Prakash
Answers.Body: <p>For me the problem was Apache was running yet it was not properly configured. Running <code>/usr/sbin/apache2 -V</code> gave me the following error.</p>
  
  <pre><code>[Mon Apr 21 17:36:38.019213 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
  [Mon Apr 21 17:36:38.019345 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_PID_FILE} is not defined
  [Mon Apr 21 17:36:38.019370 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_USER} is not defined
  [Mon Apr 21 17:36:38.019385 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
  [Mon Apr 21 17:36:38.019414 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  [Mon Apr 21 17:36:38.028756 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  [Mon Apr 21 17:36:38.029032 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  [Mon Apr 21 17:36:38.029056 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
  Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
  </code></pre>
  
  <p><a href="https://askubuntu.com/questions/452042/why-is-my-apache-not-working-after-upgrading-to-ubuntu-14-04/532858#532858">This</a> solution worked for me.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-01T13:42:12.347Z
Answers.LastActivityDate: 2016-05-01T13:42:12.347Z
Answers.LastEditDate: 2017-04-13T12:25:25.083Z
Answers.UserDisplayName: Dilip Raj Baral
Body: <p>The setup for buildkit runs smoothly, until  the 'amp test' command where it fails no matter what I do. I have tried over and over again for 6 hours. I'm new to this so maybe I'm making a basic mistake. Following are the exact steps and configurations I used, along with the output. Please help if you can.</p>
  
  <ul>
  <li>Linux Mint 17.1 fully updated, fresh install, on</li>
  <li>Virtual Box (running also in Linux Mint 17.1)</li>
  <li>Apache/2.4.7 (Ubuntu)</li>
  <li>PHP Version 5.5.9-1ubuntu4.9</li>
  </ul>
  
  <p>As far as I can tell all the prerequisites are fulfilled. Following are the commands, reports and configuration I used:</p>
  
  <pre><code>apt-get install curl
  
  comment: Note the new setup script name for Node.js v0.12
  curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
  
  comment: Then install with:
  sudo apt-get install -y nodejs
  
  Use software manager to install:
  Ruby and 
  Rake
  
  git clone "https://github.com/civicrm/civicrm-buildkit.git" "/opt/buildkit"
  export PATH="/opt/buildkit/bin:$PATH"
  
  civi-download-tools
  
  sudo service apache2 restart
  
  amp config
  
  Enter mysql_dsn&gt; mysql://root:my_password@localhost:3306
  
  Enter perm_type  [1] "linuxAcl": Set tight, inheritable permissions with Linux ACLs [setfacl] (recommended)
  
  Enter perm_user&gt;  www-data
  Enter httpd_type apache24
  
  Note: Please add this line to the httpd.conf or apache2.conf:
  
    Include /root/.amp/apache.d/*.conf
  
  service apache2 restart
  
  amp test
  
  Connect to test application
  Expect response: "response-code-vh4D13nHwi"
  PHP Warning:  file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
   in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153
  
  Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
   in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153
  Received incorrect response: ""
  Tip: Try running "amp config" and/or restarting the webserver.
  Mint17a buildkit # 
  </code></pre>
  
  <p>Even if I set the following permissions I still get errors:</p>
  
  <ul>
  <li>group and full permissions for /opt/buildkit = www-data</li>
  <li>group and full permissions for /var/www = www-data</li>
  </ul>
  
  <p>Thanks in advance!</p>
  
Tags: <civicrm-buildkit>
Title: Buildkit -- Warning: file_get_contents(http://localhost:7979/index.php): failed
ThreadText: # Buildkit -- Warning: file_get_contents(http://localhost:7979/index.php): failed
  
  (Asked by: username_0 on 2015-05-17)
  
  The setup for buildkit runs smoothly, until the 'amp test' command where it fails no matter what I do. I have tried over and over again for 6 hours. I'm new to this so maybe I'm making a basic mistake. Following are the exact steps and configurations I used, along with the output. Please help if you can.
  
  * Linux Mint 17.1 fully updated, fresh install, on
  * Virtual Box (running also in Linux Mint 17.1)
  * Apache/2.4.7 (Ubuntu)
  * PHP Version 5.5.9-1ubuntu4.9
  
  As far as I can tell all the prerequisites are fulfilled. Following are the commands, reports and configuration I used:
  
  ```
  apt-get install curl
  
  comment: Note the new setup script name for Node.js v0.12
  curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
  
  comment: Then install with:
  sudo apt-get install -y nodejs
  
  Use software manager to install:
  Ruby and 
  Rake
  
  git clone "https://github.com/civicrm/civicrm-buildkit.git" "/opt/buildkit"
  export PATH="/opt/buildkit/bin:$PATH"
  
  civi-download-tools
  
  sudo service apache2 restart
  
  amp config
  
  Enter mysql_dsn> mysql://root:my_password@localhost:3306
  
  Enter perm_type  [1] "linuxAcl": Set tight, inheritable permissions with Linux ACLs [setfacl] (recommended)
  
  Enter perm_user>  www-data
  Enter httpd_type apache24
  
  Note: Please add this line to the httpd.conf or apache2.conf:
  
    Include /root/.amp/apache.d/*.conf
  
  service apache2 restart
  
  amp test
  
  Connect to test application
  Expect response: "response-code-vh4D13nHwi"
  PHP Warning:  file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
   in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153
  
  Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
   in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153
  Received incorrect response: ""
  Tip: Try running "amp config" and/or restarting the webserver.
  Mint17a buildkit # 
  
  ```
  
  Even if I set the following permissions I still get errors:
  
  * group and full permissions for /opt/buildkit = www-data
  * group and full permissions for /var/www = www-data
  
  Thanks in advance!
  
  **Tags:** civicrm-buildkit
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2015-05-17. Score: 5
  
  Check that you've followed this instruction?
  
  > Note: Please add this line to the httpd.conf or apache2.conf:
  
  ```
  Include /root/.amp/apache.d/*.conf
  
  ```
  
  To do this, edit your Apache configuration (on Debian I'd create `/etc/apache2/conf.d/civicrm-buildkit.conf`) and add that line.
  
  ---
  
  Check that you can open `http://localhost:7979` (or the URL reported by your `amp test`) from the machine you're working on (`curl http://localhost:7979/index.php` etc).
  
  * A DNS failure suggests that your machine cannot resolve `localhost` - check `/etc/hosts` is correctly configured.
  * A connection failure suggests Apache configuration - check that Apache is seeing the configuration and able to bind to appropriate ports.
  * Errors in the output from curl, and further information in Apache / PHP error logs should give further information about what needs fixing.
  
  > **Comments:**
  > **username_0**: I had put that line in.  Since the error report stated "file_get_contents(http://localhost:7979/index.php): failed to open" I thought I'd check info on that port. Here's what I got:  Mint17a tech #  netstat -tulpn | grep :7979 tcp6       0      0 :::7979                 :::*                    LISTEN      25242/apache2   Does that help you?  Yes, I did restart apache2 many times  
  > **username_1**: And restarted apache? (Can't tell from formatting if the inclusion happened before `service apache2 restart`)  
  > **username_0**: I cleared the logs at /var/log/apache2 and then retried amp test. I then checked the logs and all three (access.log, error.log, other_vhosts_access.log) were empty of any reports.  
  > **username_1**: What do you see at http://localhost:7979/index.php when you do that? Could it be that `/etc/hosts` is missing localhost, so http://localhost doesn't resolve?  
  > **username_0**: Sorry, failed to follow directions carefully: localhost:7070/index.php resulted in the following access log entry:127.0.0.1 - - [18/May/2015:16:37:46 -0700] "GET /favicon.ico HTTP/1.1" 404 499 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0". There is no enty in error.log  
  > **username_1**: See updated answer? I think you're not seeing the whole story there; if you got a 404 for favicon.ico I'd expect to also see an entry for the preceding request. You spotted the 7979 vs 7070 in previous reply, right?  
  > **username_0**: Firefox can't establish a connection to the server at localhost:7070. I am rebuilding my virtualbox with Linux Mint 17.1 from scratch just to be sure there is nothing wrong there. Since stackexchange is suggesting move this to chat I'll try that when I'm done with the fresh install. Thank you.  
  > **username_2**: @username_0 you had any luck with this issue?  
  > **username_0**: I gave up on the buildkit process, and that is so long ago that I fail to remember even why I was exploring it. If might be a good idea if you make a new question to fit  your situation. I did find that doing my experiments in a virtualbox was immensely help full ... I must have a good twenty virtualbox copies now, even after thinning them down. Hope this helps in some way.  
  
  ---
  
  ### Answer by username_3 on 2016-04-15. Score: 1
  
  Sorry to bump into an older post, I just wanted to share my experience while setting up CiviCRM development. So I already have an up and running instance of Civi drupal-demo site (which I did setup up an year ago) but recently I was again setting up development environment on other machine.
  
  All the steps worked pretty well till `amp test`. Again I experienced the same PHP warnings while performing this test as username_0 as specified here above.
  
  So to overcome this, I added specific permissions to the directory of buildkit in apache2.conf (in my case it is /opt/buildkit). Then I sudo chmod permissions to the directory.
  Here is the code I added in apache2.conf :
  
  ```
  <Directory /opt/buildkit>
          Options Indexes FollowSymLinks
          AllowOverride None
          Require all granted
  </Directory>
  
  ```
  
  Or you can add your root directory with more configuration if it doesn't work (not recommended).
  
  ```
  <Directory />
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
      Allow from all
  </Directory>
  
  ```
  
  Hope it helps new upcoming Civi developers.
  
  Thank you.
  
  
  ---
  
  ### Answer by username_4 on 2018-07-10. Score: 1
  
  I had the same problem and the issue was that my web server is Apache 2.4 and I had set the httpd\_type to "apache" instead of "apache24" when running amp config.
  
  I solved the issue by giving chmod permissions to buildkit and .amp directories and setting httpd\_type to "apache24"
  
  More info [here](https://github.com/civicrm/civicrm-buildkit/issues/122#issuecomment-68739172)
  
  
  ---
  
  ### Answer by username_2 on 2016-05-01. Score: 0
  
  For me the problem was Apache was running yet it was not properly configured. Running `/usr/sbin/apache2 -V` gave me the following error.
  
  ```
  [Mon Apr 21 17:36:38.019213 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
  [Mon Apr 21 17:36:38.019345 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_PID_FILE} is not defined
  [Mon Apr 21 17:36:38.019370 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_USER} is not defined
  [Mon Apr 21 17:36:38.019385 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
  [Mon Apr 21 17:36:38.019414 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  [Mon Apr 21 17:36:38.028756 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  [Mon Apr 21 17:36:38.029032 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  [Mon Apr 21 17:36:38.029056 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
  AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
  Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
  
  ```
  
  [This](https://askubuntu.com/questions/452042/why-is-my-apache-not-working-after-upgrading-to-ubuntu-14-04/532858#532858) solution worked for me.
  
  
  ---
  
  