title: How to switch between PHP 5.6 / 7.2 on Cloud9?
body: <p>I use AWS Cloud9 Amazon Web Services a.k.a. Cloud9 IDE. I’m trying to achieve a setup where I can easily switch the frontend (not CLI) PHP version with PHPBrew between 5.6 and 7 whenever. For now, I’ve only achieved that the bash has the 5.6.31, the frontend <code>phpinfo()</code> says PHP Version 5.5.9-1ubuntu4.17 which is obviously something I don’t want to see. I’ve already managed to do this on another workspace where it says PHP Version 5.6.31, but I’m afraid to touch that workspace to venture into trying to switch to PHP 7. I have no idea how I achieved to make the PHPBrew version the system level PHP…</p>
  
  <p>I’ve read the related topics and questions but they aren’t helping me. This is how I set it up for now:</p>
  
  <pre><code>curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew 
  chmod +x phpbrew
  sudo mv phpbrew /usr/local/bin/phpbrew
  phpbrew -v
  phpbrew init
  echo '[[ -e /home/ubuntu/.phpbrew/bashrc ]] &amp;&amp; source /home/ubuntu/.phpbrew/bashrc' &gt;&gt; ~/.bashrc 
  
  sudo apt-get update
  sudo apt-get install apache2-dev
  sudo apt-get install libcurl4-gnutls-dev
  sudo apt-get install libmcrypt-dev libreadline-dev
  sudo phpbrew install php-5.6.31 +default +dbs +mb +iconv +apxs2=/usr/bin/apxs2
  </code></pre>
  
  <p>Please note that I have no earthly idea what I’m doing, I never used Linux. I just collected these lines from threads like this and they looked promising, but I must be missing something.</p>
  
  <p>Additional info (requested in comments):</p>
  
  <pre><code>$ cat /etc/apache2/mods-available/php5.load
  LoadModule php5_module        /usr/lib/apache2/modules/libphp5.6.31.so
  
  $ phpbrew list
  * php-5.6.31 
  </code></pre>
  
  <p>I'd ideally switch with <code>phpbrew switch</code> after I have both 5.6.31 and 7 installed. For now, I'd be satisfied if I could just get it to work with 5.6.31</p>
  
  <p>For now, what I did was to switch the "runner" (not sure what that is) from <em>PHP (built-in web server)</em> to <em>Apache httpd (PHP, HTML)</em> here: <a href="https://i.snag.gy/Y6eNHy.jpg" rel="noreferrer">https://i.snag.gy/Y6eNHy.jpg</a> Then the <code>phpinfo()</code> was actually showing the phpbrew version. Then I also <a href="https://gist.github.com/Thefirsh/d6571f07d60ee3c88b21b66059694bac" rel="noreferrer">installed PHP 7.2.1</a> but then everything stopped working. I get lots of errors in the console of c9: <a href="https://i.snag.gy/pt5oHN.jpg" rel="noreferrer">https://i.snag.gy/pt5oHN.jpg</a> Beautiful, isn't it? :)</p>
  
  <pre><code>Started apache2
  /mnt/shared/bin/run-apache2: line 70:  4813 Segmentation fault      apache2
  </code></pre>