简体   繁体   中英

How to configure php in netbeans so that it's pointing to “opt/lampp/bin/php” instead of “/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.

Have you eg 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM