douliang9057 2014-06-18 12:42
浏览 60
已采纳

如何在netbeans中配置php,使其指向“opt / lampp / bin / php”而不是“/ usr / bin / php”?

I'm using linux and installed xampp that already provided php in its package. Then, I add "export PATH=/opt/lampp/bin:$PATH" to my "~/.bashrc" so that I can use every commands that is provided in xampp directly from my terminal (without needed to pointing to "/opt/lampp/bin"). Everything works fine.

My problem is I'm using netbeans and when I tried to execute my program, it said "/usr/bin/env: php: No such file" I know it happened because there's no php in my "/usr/bin" since I have it via xampp, but I do have it in my "/opt/lampp/bin". How to configure PHP in netbeans so that it's pointing to "/opt/lampp/bin", instead of "/usr/bin"?

I've googled it and they said that I need to install php-cli, which I think is not a good choice since it makes me have two php in my system. IS there any way for me to use netbeans and php from xampp without needed to install php-cli?

I've also tried to Tools->Options->PHP-General and provide PHP interpreter poiting to "/opt/lampp/bin/php" but it didn't work.

  • 写回答

1条回答 默认 最新

  • dongquming3255 2014-06-18 20:19
    关注

    Have you e.g. restarted OS after editing .bashrc file? Or run in command line

     . ~/.bashrc
    

    to apply changes in bashrc and then start NetBeans and give it another try. Another option could be to use symbolic link

    sudo ln -s /opt/lampp/bin/php /usr/bin/php
    

    If you run "which php" does it point to the lampp directory?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效