php related error in linux terminal while setting up symfony framework

戏子无情 提交于 2019-12-11 06:26:20

问题


i am trying to setup a new symfony framework project on ubuntu by following the documentation. But all the commands mentioned in the docs starting with 'php' give out the following error.

The program 'php' is currently not installed.  You can install it by typing:
sudo apt-get install php5-cli
bash: php: command not found.

But php is installed and running on the system! How do i get past this error ?

Thanks in advance.


回答1:


There are several different PHP packages; probably the one that is installed is the PHP module for Apache, not the command-line (CLI) version invoked as php.

Just run the command like it says, and you should be fine.




回答2:


Is php on your path? (does it start if you just type in 'php' at the prompt or do you need to specify a path?)

If so, then its possible that the path is hardcoded to look elsewhere for your PHP executable. Try grepping the scripts to see where its looking.

If php is NOT on your path then try adding it, e.g. if php is in /usr/local/bin (and /usr/local/bin is not currently on your path)

export PATH=$PATH:/usr/local/bin

HTH

C.



来源:https://stackoverflow.com/questions/3117665/php-related-error-in-linux-terminal-while-setting-up-symfony-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!