Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizGeneral Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
The message you see is triggered by a shell function called command_not_found_handle
defined in your system wide bashrc (/etc/bash.bashrc
). This function is called by the bash when you enter the name of a binary which is not found in the current PATH. On Ubuntu, this uses a tool called command-not-found to search your input against a package database and suggest a package that might contain the command you entered.
Depending on how you installed your LAMP stack - by using apt-get a lot or unblobbing a big tar file - there are two answers to your question.
In case you did apt-get all the stack applications you just did not install the php-cli package. In that case you can do sudo apt-get install php7.0-cli
and you are fine.
In your question you mention /opt/lamp
which suggests that you did the unblob-a-tar thing. This means that you should have a php cli binary somewhere in a bin
directory under your /opt/lamp
. What you can do is
/opt/lamp/bin/php -v
: this is perfect if you call it only now and thenln -s /opt/lamp/bin/php /usr/bin/php
: helpful if the LAMP version is the only version in your system and you use it regularybin/php
is just an example here - your actual binary might be in a different directory under a different name. Replace it with the correct path once you found it.
If you install a full binary package in /opt
it might be a good idea to check if it and if so how it uses libraries that exist in your core system. You can do this by issuing ldd /opt/lamp/bin/php
and check the paths of the libs that are printed. Sometimes you get into trouble when those binaries still use your system libs but expect different versions.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
manpreet
Best Answer
2 years ago
I have installed LAMP in my ubuntu environment (16.04) which has apache, php (7.0.9), mysql...
Although the php functionality is there, when i type 'php -v' in the terminal, i get the message
which as i understand means that ubuntu does not recognise the php installation from LAMP .
Is there a way to tell ubuntu that there is a php installation in opt/lamp... in order to recognise it?