V
V
Vladimir2019-02-07 19:11:47
linux
Vladimir, 2019-02-07 19:11:47

How to run .php script on server via linux console?

I try to run the script with the command
php 1.php
php7 1.php
php7-cli 1.php
writes
-bash: php7-cli: command not found
When I run the command php -v
-bash: php: command not found
linux version: # cat /etc /*-release
CentOS release 6.10 (Final)
PHP Version 7.1.26

Answer the question

In order to leave comments, you need to log in

5 answer(s)
W
Wexter, 2019-02-07
@Wexter

https://www.tecmint.com/install-php-7-in-centos-7/

A
Andrey, 2019-02-07
@VELIK505

php -v
-bash: php: command not found

Well, php is not installed on the server. What is not clear? or you don't have root permissions that can't go below /var/www/
Check also:
find /etc/ -iname "*php*"

T
ThunderCat, 2019-02-07
@ThunderCat

look for where puff lies in your distribution:
whereis php
we write with paths

V
Vlad, 2019-04-15
@Rid-lin

You just need to find where the php executable is located
And if it doesn't work then
find / -iname "*php*"

V
Vladimir L, 2019-04-18
@Lobochkin

are you talking about the php.ini file?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question