2015-01-16 1 views
9

그래서 내가 명령을 실행하면 모든 것이 잘 설치, 냠와 EPEL의 REPO을 사용하고 있습니다 :PHP 명령은 냠 - CLI php55-PHP를 설치 한 후 발견되지

sudo yum install php55-php-cli 

을 내가 실행 그러나 때

php 

php command not found 

사람이 왜 알고 있나요 :

나는 오류를 얻을?

갱신 가

사람들은 내가 yum search php5 | grep 'cli'을 수행 할 때 결과가 잘못되는 설치 주위에 다른 패키지를 던지고있다

:

php54-php-cli.x86_64 : Command-line interface for PHP 
php54-php-pecl-ircclient.x86_64 : IRC Client 
php54-php-pecl-radius.x86_64 : Radius client library 
php54-php-pecl-stomp.x86_64 : Stomp client extension 
php54-php-pecl-yaz.x86_64 : Z39.50/SRU client 
php55-php-cli.x86_64 : Command-line interface for PHP 
php55-php-pecl-ircclient.x86_64 : IRC Client 
php55-php-pecl-radius.x86_64 : Radius client library 
php55-php-pecl-stomp.x86_64 : Stomp client extension 
php55-php-pecl-yaz.x86_64 : Z39.50/SRU client 
php56-php-cli.x86_64 : Command-line interface for PHP 
php56-php-pecl-ircclient.x86_64 : IRC Client 
php56-php-pecl-radius.x86_64 : Radius client library 
php56-php-pecl-stomp.x86_64 : Stomp client extension 
php56-php-pecl-yaz.x86_64 : Z39.50/SRU client 
+1

'echo' '> test.php' 그리고 나서'php -q test.php'. 'test'가 여러분의 콘솔에 나타나면, 작동합니다. 그렇지 않은 경우 설치가 잘못되었다는 가능성이 가장 높습니다. –

+0

php 명령을 찾을 수 없습니다, yum php55-php-cli를 설치하는 곳과 관련이 있습니까? –

+1

그런데'sudo yum install php55-cli' 또는'sudo yum install php5-cli'을 시도해보십시오. php55-php-cli는 나에게 맞는 것 같지 않습니다. –

답변

31

모든 헤이와 미래의 나 (I이 다음을 잊고 -의 것 년),

이 문제를 해결하기 위해 두 가지 작업을 수행했습니다.

  1. yum install php55
  2. source /opt/remi/php55/enable
  3. 실행 테스트 php -v now works

    갱신

    당신이 source 그래서 난 다른 해결책을 발견 명령을 실행할 수 없습니다 꼭두각시를 사용하는 경우

    명령 ls -la을 실행하면 당신은 PHP가 실행 볼 수 있지만이 php56 -v을 할 경우 나의 두 번째 옵션에서 레미를 설치 한 후 나는 고정 표시기에서 이것을 실행 /opt/remi/php56/root/usr/bin/php

    [[email protected] ~]$ ls -la /usr/bin/ | grep 'php' 
    lrwxrwxrwx 1 root root  32 Jan 28 16:57 php56 -> /opt/remi/php56/root/usr/bin/php 
    lrwxrwxrwx 1 root root  36 Jan 28 16:57 php56-cgi -> /opt/remi/php56/root/usr/bin/php-cgi 
    lrwxrwxrwx 1 root root  33 Jan 28 16:57 php56-pear -> /opt/remi/php56/root/usr/bin/pear 
    lrwxrwxrwx 1 root root  38 Jan 28 16:57 php56-phar -> /opt/remi/php56/root/usr/bin/phar.phar 
    
+1

CentOS 6의 경우'yum install php54'를 설치 한 후'php' 명령을 실행하기 위해'source/opt/rh/php54/enable'을 실행했습니다 line – keeg

+1

'symlink'접근 방식을 사용해야했습니다. PATH 변수에 나열된 폴더 중 하나에서 수행해야합니다. -/usr/local/bin에서 명령을 실행했습니다. –

+1

이것은 rh-php56에서도 동일하게 작동합니다. 재부팅 후에 무엇을 기대해야할지 모르겠다면, 그 시점에 심볼릭 링크를 만들어야 할 수도 있습니다 ... – blamb

3

(PHP는 심볼릭 링크하는 것 centos7) PHP 5.5.34 (CLI)

PHP는 -m 쇼 올바른 모듈을 반환 -v

yum -y --enablerepo remi,remi-php55 install php.x86_64 php-pecl-apcu.x86_64 php-pecl-memcached.x86_64 php-pecl-xdebug.x86_64 

PHP

php --ini는 /etc/php.d에있는 모든 ini 파일이 올바르게 설치되었음을 나타냅니다.

관련 문제