I can't run php on CLI
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
When I install it again it says php is already the newest version.
when I run php -v
the out put is this:
The program 'php' can be found in the following packages:
* php7.0-cli
* hhvm
Try: sudo apt install <selected package>
when runing type php
:
bash: type: php: not found
When I run whereis php
the out put is this:
$ whereis php
php: /usr/bin/php.old /usr/bin/php7.0 /usr/lib/php /etc/php /usr/share/php7.0-common /usr/share/php7.0-intl /usr/share/php7.0-json /usr/share/php /usr/share/php7.0-zip /usr/share/php7.0-mcrypt /usr/share/php7.0-mysql /usr/share/php7.0-readline /usr/share/php7.0-opcache /usr/share/php7.0-xml /usr/share/php7.0-mbstring /usr/share/php7.0-gd /usr/share/man/man1/php.1.gz
I have looked for solutions but none of them worked.
16.04 php
add a comment |Â
up vote
1
down vote
favorite
When I install it again it says php is already the newest version.
when I run php -v
the out put is this:
The program 'php' can be found in the following packages:
* php7.0-cli
* hhvm
Try: sudo apt install <selected package>
when runing type php
:
bash: type: php: not found
When I run whereis php
the out put is this:
$ whereis php
php: /usr/bin/php.old /usr/bin/php7.0 /usr/lib/php /etc/php /usr/share/php7.0-common /usr/share/php7.0-intl /usr/share/php7.0-json /usr/share/php /usr/share/php7.0-zip /usr/share/php7.0-mcrypt /usr/share/php7.0-mysql /usr/share/php7.0-readline /usr/share/php7.0-opcache /usr/share/php7.0-xml /usr/share/php7.0-mbstring /usr/share/php7.0-gd /usr/share/man/man1/php.1.gz
I have looked for solutions but none of them worked.
16.04 php
1
/usr/bin/php7.0 ???
â cmak.fr
May 24 at 17:18
1
Please post the output from when you try to runphp
, including the exact command you use. Also post the output oftype php
; this is more useful thanwhereis php
orwhich php
. You can edit your question to add info. By the way, welcome to Ask Ubuntu!
â wjandrea
May 24 at 17:26
@wjandrea just did. please i need a solution asap.
â Robgogo
May 24 at 17:53
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When I install it again it says php is already the newest version.
when I run php -v
the out put is this:
The program 'php' can be found in the following packages:
* php7.0-cli
* hhvm
Try: sudo apt install <selected package>
when runing type php
:
bash: type: php: not found
When I run whereis php
the out put is this:
$ whereis php
php: /usr/bin/php.old /usr/bin/php7.0 /usr/lib/php /etc/php /usr/share/php7.0-common /usr/share/php7.0-intl /usr/share/php7.0-json /usr/share/php /usr/share/php7.0-zip /usr/share/php7.0-mcrypt /usr/share/php7.0-mysql /usr/share/php7.0-readline /usr/share/php7.0-opcache /usr/share/php7.0-xml /usr/share/php7.0-mbstring /usr/share/php7.0-gd /usr/share/man/man1/php.1.gz
I have looked for solutions but none of them worked.
16.04 php
When I install it again it says php is already the newest version.
when I run php -v
the out put is this:
The program 'php' can be found in the following packages:
* php7.0-cli
* hhvm
Try: sudo apt install <selected package>
when runing type php
:
bash: type: php: not found
When I run whereis php
the out put is this:
$ whereis php
php: /usr/bin/php.old /usr/bin/php7.0 /usr/lib/php /etc/php /usr/share/php7.0-common /usr/share/php7.0-intl /usr/share/php7.0-json /usr/share/php /usr/share/php7.0-zip /usr/share/php7.0-mcrypt /usr/share/php7.0-mysql /usr/share/php7.0-readline /usr/share/php7.0-opcache /usr/share/php7.0-xml /usr/share/php7.0-mbstring /usr/share/php7.0-gd /usr/share/man/man1/php.1.gz
I have looked for solutions but none of them worked.
16.04 php
edited May 24 at 17:52
asked May 24 at 17:09
Robgogo
62
62
1
/usr/bin/php7.0 ???
â cmak.fr
May 24 at 17:18
1
Please post the output from when you try to runphp
, including the exact command you use. Also post the output oftype php
; this is more useful thanwhereis php
orwhich php
. You can edit your question to add info. By the way, welcome to Ask Ubuntu!
â wjandrea
May 24 at 17:26
@wjandrea just did. please i need a solution asap.
â Robgogo
May 24 at 17:53
add a comment |Â
1
/usr/bin/php7.0 ???
â cmak.fr
May 24 at 17:18
1
Please post the output from when you try to runphp
, including the exact command you use. Also post the output oftype php
; this is more useful thanwhereis php
orwhich php
. You can edit your question to add info. By the way, welcome to Ask Ubuntu!
â wjandrea
May 24 at 17:26
@wjandrea just did. please i need a solution asap.
â Robgogo
May 24 at 17:53
1
1
/usr/bin/php7.0 ???
â cmak.fr
May 24 at 17:18
/usr/bin/php7.0 ???
â cmak.fr
May 24 at 17:18
1
1
Please post the output from when you try to run
php
, including the exact command you use. Also post the output of type php
; this is more useful than whereis php
or which php
. You can edit your question to add info. By the way, welcome to Ask Ubuntu!â wjandrea
May 24 at 17:26
Please post the output from when you try to run
php
, including the exact command you use. Also post the output of type php
; this is more useful than whereis php
or which php
. You can edit your question to add info. By the way, welcome to Ask Ubuntu!â wjandrea
May 24 at 17:26
@wjandrea just did. please i need a solution asap.
â Robgogo
May 24 at 17:53
@wjandrea just did. please i need a solution asap.
â Robgogo
May 24 at 17:53
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
I've never used PHP, so take this with a grain of salt:
It looks like /usr/bin/php
got renamed to php.old
. I'm guessing if you run readlink /usr/bin/php.old
it will point to /usr/bin/php7.0
. If so, you can un-rename it by running
sudo mv /usr/bin/php.old /usr/bin/php
Otherwise, you could create a new /usr/bin/php
:
sudo ln -s php7.0 /usr/bin/php
Or reinstall the whole package:
sudo apt-get install --reinstall php7.0-cli
add a comment |Â
up vote
1
down vote
Looks like you have php7.0-cli
installed, but no /usr/bin/php
. The latter is normally a symlink managed by the alternatives system. You can show the status of that by issuing the following command:
$ update-alternatives --display php
php - automatischer Modus
beste Version des Links ist /usr/bin/php7.0
Link verweist zur Zeit auf /usr/bin/php7.0
Link php ist /usr/bin/php
Slave php.1.gz ist /usr/share/man/man1/php.1.gz
/usr/bin/php7.0 - Priorität 70
Slave php.1.gz: /usr/share/man/man1/php7.0.1.gz
If this shows different output on your computer this is probably not set correctly. You can try to run update-alternatives --auto php
and test again if a) php -v
works now and b) update-alternatives --display php
now produces output similar to the above.
If this didn't help you can manually set the alternative: update-alternatives --set php /usr/bin/php7.0
and test again.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I've never used PHP, so take this with a grain of salt:
It looks like /usr/bin/php
got renamed to php.old
. I'm guessing if you run readlink /usr/bin/php.old
it will point to /usr/bin/php7.0
. If so, you can un-rename it by running
sudo mv /usr/bin/php.old /usr/bin/php
Otherwise, you could create a new /usr/bin/php
:
sudo ln -s php7.0 /usr/bin/php
Or reinstall the whole package:
sudo apt-get install --reinstall php7.0-cli
add a comment |Â
up vote
1
down vote
I've never used PHP, so take this with a grain of salt:
It looks like /usr/bin/php
got renamed to php.old
. I'm guessing if you run readlink /usr/bin/php.old
it will point to /usr/bin/php7.0
. If so, you can un-rename it by running
sudo mv /usr/bin/php.old /usr/bin/php
Otherwise, you could create a new /usr/bin/php
:
sudo ln -s php7.0 /usr/bin/php
Or reinstall the whole package:
sudo apt-get install --reinstall php7.0-cli
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I've never used PHP, so take this with a grain of salt:
It looks like /usr/bin/php
got renamed to php.old
. I'm guessing if you run readlink /usr/bin/php.old
it will point to /usr/bin/php7.0
. If so, you can un-rename it by running
sudo mv /usr/bin/php.old /usr/bin/php
Otherwise, you could create a new /usr/bin/php
:
sudo ln -s php7.0 /usr/bin/php
Or reinstall the whole package:
sudo apt-get install --reinstall php7.0-cli
I've never used PHP, so take this with a grain of salt:
It looks like /usr/bin/php
got renamed to php.old
. I'm guessing if you run readlink /usr/bin/php.old
it will point to /usr/bin/php7.0
. If so, you can un-rename it by running
sudo mv /usr/bin/php.old /usr/bin/php
Otherwise, you could create a new /usr/bin/php
:
sudo ln -s php7.0 /usr/bin/php
Or reinstall the whole package:
sudo apt-get install --reinstall php7.0-cli
answered May 24 at 19:12
![](https://i.stack.imgur.com/eVuAv.png?s=32&g=1)
![](https://i.stack.imgur.com/eVuAv.png?s=32&g=1)
wjandrea
7,02542054
7,02542054
add a comment |Â
add a comment |Â
up vote
1
down vote
Looks like you have php7.0-cli
installed, but no /usr/bin/php
. The latter is normally a symlink managed by the alternatives system. You can show the status of that by issuing the following command:
$ update-alternatives --display php
php - automatischer Modus
beste Version des Links ist /usr/bin/php7.0
Link verweist zur Zeit auf /usr/bin/php7.0
Link php ist /usr/bin/php
Slave php.1.gz ist /usr/share/man/man1/php.1.gz
/usr/bin/php7.0 - Priorität 70
Slave php.1.gz: /usr/share/man/man1/php7.0.1.gz
If this shows different output on your computer this is probably not set correctly. You can try to run update-alternatives --auto php
and test again if a) php -v
works now and b) update-alternatives --display php
now produces output similar to the above.
If this didn't help you can manually set the alternative: update-alternatives --set php /usr/bin/php7.0
and test again.
add a comment |Â
up vote
1
down vote
Looks like you have php7.0-cli
installed, but no /usr/bin/php
. The latter is normally a symlink managed by the alternatives system. You can show the status of that by issuing the following command:
$ update-alternatives --display php
php - automatischer Modus
beste Version des Links ist /usr/bin/php7.0
Link verweist zur Zeit auf /usr/bin/php7.0
Link php ist /usr/bin/php
Slave php.1.gz ist /usr/share/man/man1/php.1.gz
/usr/bin/php7.0 - Priorität 70
Slave php.1.gz: /usr/share/man/man1/php7.0.1.gz
If this shows different output on your computer this is probably not set correctly. You can try to run update-alternatives --auto php
and test again if a) php -v
works now and b) update-alternatives --display php
now produces output similar to the above.
If this didn't help you can manually set the alternative: update-alternatives --set php /usr/bin/php7.0
and test again.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Looks like you have php7.0-cli
installed, but no /usr/bin/php
. The latter is normally a symlink managed by the alternatives system. You can show the status of that by issuing the following command:
$ update-alternatives --display php
php - automatischer Modus
beste Version des Links ist /usr/bin/php7.0
Link verweist zur Zeit auf /usr/bin/php7.0
Link php ist /usr/bin/php
Slave php.1.gz ist /usr/share/man/man1/php.1.gz
/usr/bin/php7.0 - Priorität 70
Slave php.1.gz: /usr/share/man/man1/php7.0.1.gz
If this shows different output on your computer this is probably not set correctly. You can try to run update-alternatives --auto php
and test again if a) php -v
works now and b) update-alternatives --display php
now produces output similar to the above.
If this didn't help you can manually set the alternative: update-alternatives --set php /usr/bin/php7.0
and test again.
Looks like you have php7.0-cli
installed, but no /usr/bin/php
. The latter is normally a symlink managed by the alternatives system. You can show the status of that by issuing the following command:
$ update-alternatives --display php
php - automatischer Modus
beste Version des Links ist /usr/bin/php7.0
Link verweist zur Zeit auf /usr/bin/php7.0
Link php ist /usr/bin/php
Slave php.1.gz ist /usr/share/man/man1/php.1.gz
/usr/bin/php7.0 - Priorität 70
Slave php.1.gz: /usr/share/man/man1/php7.0.1.gz
If this shows different output on your computer this is probably not set correctly. You can try to run update-alternatives --auto php
and test again if a) php -v
works now and b) update-alternatives --display php
now produces output similar to the above.
If this didn't help you can manually set the alternative: update-alternatives --set php /usr/bin/php7.0
and test again.
answered May 24 at 19:36
![](https://i.stack.imgur.com/k9JBf.jpg?s=32&g=1)
![](https://i.stack.imgur.com/k9JBf.jpg?s=32&g=1)
Lienhart Woitok
808211
808211
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1039914%2fi-cant-run-php-on-cli%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
/usr/bin/php7.0 ???
â cmak.fr
May 24 at 17:18
1
Please post the output from when you try to run
php
, including the exact command you use. Also post the output oftype php
; this is more useful thanwhereis php
orwhich php
. You can edit your question to add info. By the way, welcome to Ask Ubuntu!â wjandrea
May 24 at 17:26
@wjandrea just did. please i need a solution asap.
â Robgogo
May 24 at 17:53