Phalcon devtools not working

I am trying to install Phalcon Dev Tools on OSX. I have Phalcon installed and it works great.

I followed these instructions: http://docs.phalconphp.com/en/latest/reference/mactools.html

When I run the phalcon command in the terminal, I get the following output:

 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! 

Now how to use devtools? When I enter phalcon commands , the output is exactly the same as above, and continues to tell me that it is installed.

Did I miss something?

I noticed in the phalcon.sh script, at the end it had:

 if check_install; then php "$PTOOLSPATH/phalcon.php" $* fi 

So, if check_install passes, run phalcon.php . I tried to run this script manually and nothing happens on the terminal.

$PTOOLSPATH . I confirmed this with echo $PTOOLSPATH .

My /usr/bin/env php correct and points to MAMP PHP. I currently have Phalcon installed using MAMP. My PHP is correct:

 which php /Applications/MAMP/bin/php/php5.5.23/bin/php 

Checking the phalcon.php script and using xdebug, I found that the problem lies here:

 if (!extension_loaded('phalcon')) { throw new Exception( sprintf( "Phalcon extension isn't installed, follow these instructions to install it: %s", Script::DOC_INSTALL_URL ) ); } 

Therefore, the Phalcon extension does not load. Not sure why it is not printing the exception output in the terminal. But the PHP error log shows:

 [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 

Now I'm at a standstill.

Edit:

Running php -m showed me that Phalcon is not installed. Which is strange because I use Phalcon in my web application and it works great. As you can see, I downloaded the extension in php.ini .

enter image description here

Used version of PHP:

 PHP 5.5.23 (cli) (built: Apr 9 2015 19:29:27) 

As you can see, Phalcon is in the correct directory:

 ls /Applications/MAMP/bin/php/php5.5.23/lib/php/extensions/no-debug-non-zts-20121212 apcu.so imagick.so phalcon.so ... 

And as you can see from phpinfo() , it is installed ...

enter image description here

The following commands also give different results:

Shows Phalcon as installed:

 echo "<?php phpinfo(); ?>" | php > phpinfo.txt && cat phpinfo.txt | grep phalcon 

Indicates that Phalcon is not installed:

 php -m 

Any ideas?

+6
source share
3 answers

After many attempts, it turned out that the code shown in the reference is incorrect:

 ln -s ~/phalcon-tools/phalcon.sh ~/phalcon-tools/phalcon chmod +x ~/phalcon-tools/phalcon 

The correct way can be found in github repo :

 ln -s ~/phalcon-devtools/phalcon.php /usr/bin/phalcon chmod ugo+x /usr/bin/phalcon 

Basically, the link should not be a script, but a php file. By fixing this, I could run the dev tool correctly.

+1
source

I have the same problem with you. and I solved it while I add this two lines to my ~ / .bash_profile file.

 export PATH=$PATH:/Users/scott/phalcon-tools export PTOOLSPATH=/Users/scott/phalcon-tools 

First, I add only the first line to .bash_profile, and I get the same information with you.

0
source

Maybe the phalcon file is not installed on the ini command line, so it throws an error.

just type this command into the terminal.

 php --ini 

then check the output that the interesting line

 Loaded Configuration File: /etc/php5/cli/php.ini 

try checking that

 phalcon.so 
It also loads here

or not.

since there is a different phalcon.so file for web and cli, so we need to include " phalcon.so " in both files.

so phalcon.so is included in your php.ini website, so it runs smoothly, not on the command line, I think.

0
source

Source: https://habr.com/ru/post/987694/


All Articles