title: Phalcon devtools not working
body: <p>I'm attempting to install Phalcon Dev Tools on OSX. I have Phalcon installed and it works fine.</p>
  
  <p>I've followed the instructions from here: <a href="http://docs.phalconphp.com/en/latest/reference/mactools.html" rel="noreferrer">http://docs.phalconphp.com/en/latest/reference/mactools.html</a></p>
  
  <p>When I run the command <code>phalcon</code> in the terminal I get the following output:</p>
  
  <pre><code>Phalcon Developer Tools Installer
  Make sure phalcon.sh is in the same dir as phalcon.php and that you are     running this with sudo or as root.
  Installing Devtools...
  Working dir is: /Users/me/phalcon-tools
  Done. Devtools installed!
  </code></pre>
  
  <p>Now how do I use the devtools? When I enter <code>phalcon commands</code> the output is exactly the same as above, and continues to tell me that it's installed.</p>
  
  <p>Am I missing something here?</p>
  
  <p>I noticed in the <code>phalcon.sh</code> script, at the end it had:</p>
  
  <pre><code>if check_install; then
      php "$PTOOLSPATH/phalcon.php" $*
  fi
  </code></pre>
  
  <p>So, if check_install passes, run <code>phalcon.php</code>. I've tried to run this script manually and nothing happens at the terminal.</p>
  
  <p><code>$PTOOLSPATH</code> is defined. I confirmed this using <code>echo $PTOOLSPATH</code>.</p>
  
  <p>My <code>/usr/bin/env php</code> is correct and points to MAMP's PHP. I have Phalcon installed using MAMP at the moment. My PHP is correct:</p>
  
  <pre><code>which php
  /Applications/MAMP/bin/php/php5.5.23/bin/php
  </code></pre>
  
  <p>Inspecting the <code>phalcon.php</code> script, and using xdebug, I detected the issue to be lying here:</p>
  
  <pre><code>if (!extension_loaded('phalcon')) {
      throw new Exception(
          sprintf(
              "Phalcon extension isn't installed, follow these instructions to install it: %s",
              Script::DOC_INSTALL_URL
          )
      );
  }
  </code></pre>
  
  <p>So the Phalcon extension isn't loaded. Not sure why it's not printing the output of the exception in the terminal. But, PHP's error log is showing:</p>
  
  <pre><code>[21-May-2015 22:37:48 Europe/Berlin] PHP Fatal error:  Class 'Phalcon\Script' not found in /Users/me/phalcon-tools/phalcon.php on line 41
  </code></pre>
  
  <p>Now I'm stumped.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Running <code>php -m</code> showed me Phalcon isn't installed. Which is odd, because I am using Phalcon in my web application, and it works fine. As you can see, I've loaded the extension in the <code>php.ini</code>. </p>
  
  <p><img src="https://i.stack.imgur.com/Ew3oT.png" alt="enter image description here"></p>
  
  <p>The PHP version I'm using is:</p>
  
  <pre><code>PHP 5.5.23 (cli) (built: Apr  9 2015 19:29:27)
  </code></pre>
  
  <p>As you can see, Phalcon is in the correct directory:</p>
  
  <pre><code>ls /Applications/MAMP/bin/php/php5.5.23/lib/php/extensions/no-debug-non-zts-20121212
  apcu.so
  imagick.so
  phalcon.so
  ...
  </code></pre>
  
  <p>And as you can see from <code>phpinfo()</code> it's installed ...</p>
  
  <p><img src="https://i.stack.imgur.com/YEwhO.png" alt="enter image description here"></p>
  
  <p>The following commands both give different results too:</p>
  
  <p>Shows Phalcon as installed:</p>
  
  <pre><code>echo "&lt;?php phpinfo(); ?&gt;" | php &gt; phpinfo.txt &amp;&amp; cat phpinfo.txt | grep phalcon
  </code></pre>
  
  <p>Shows Phalcon not installed:</p>
  
  <pre><code>php -m
  </code></pre>
  
  <p>Any ideas?</p>