
다음을 사용하여 Ubuntu 16.04에 PHP 7.0과 함께 Apache를 설치하고 싶습니다.Puppet Labs Apache 모듈.
- 문서에 따르면모듈은 Ubuntu 16.04를 지원합니다..
- 이있다PHP 7.0 지원과 관련된 티켓그리고 허용되는 것이 있습니다병합 요청PHP 7.0 지원을 추가해야 합니다.
- 병합에 제공된 수정 사항이 모듈 1.9.0 버전에 포함되지 않은 것 같습니다.
질문은
- 제안된 수정 사항을 사용하고 PHP 7.0과 함께 Apache를 설치할 수 있는 방법이 있습니까?
- 매니페스트에 무엇을 써야 하나요?
Puppet 매니페스트의 다음 코드는 Ubuntu 16.04에서 작동하지 않습니다.
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
다음과 같은 오류가 발생했습니다.
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
Error: /Stage[main]/Apache::Mod::Php/Apache::Mod[php5]/Package[libapache2-mod-php5]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
나는 노력했다PHP 파일을 처리하도록 FastCGI 서버 구성하지만 이것도 거의 동일한 오류 메시지와 함께 실패합니다. 모듈은 아직 PHP 7.0에 대해 아무것도 모릅니다.
답변1
비슷한 문제가 발생했는데 이제 Pupplelabs Apache mod를 사용하여 PHP 버전을 매개변수로 전달할 수 있습니다.
class { 'apache::mod::php':
php_version => '7',
}
답변2
나는 같은 문제가 있었다. 이전 버전의 모듈을 사용하고 있었습니다.puppetlabs-아파치. 현재 버전을 다운로드했습니다(1.10.02016년 5월 20일에 출시됨) 문제가 수정되어 이제 제대로 작동하고 있습니다.
파일을 살펴보세요매니페스트/params.pp:
if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '16.04') < 0) or
($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9') < 0) {
# Only the major version is used here
$php_version = '5'
} else {
# major.minor version used since Debian stretch and Ubuntu Xenial
$php_version = '7.0'
}
보시다시피 Ubuntu 16.04에서는 기본적으로 PHP 7이 선택됩니다. php_version => 7.0
@starchx에서 제안한 대로 설정할 필요조차 없습니다 .
답변3
내 생각에는 다음과 같습니다.
아파치 설정
class { 'apache':
mpm_module => 'prefork'
}
apache::listen { '80': }
apache::listen { '443': }
추가 아파치 모듈 로드
class { 'apache::mod::rewrite': }
class { 'apache::mod::status': }
class { 'apache::mod::php': }
다음이 필요할 수도 있습니다.
package { 'php7.0':
ensure => 'installed',
}
package { 'libapache2-mod-php7.0':
ensure => 'installed',
}
package { 'libapache2-mod-php':
ensure => 'installed',
}
그것이 당신에게 더 가까워지기를 바랍니다.