I've been having some issues installing PHP 5.5 on a CentOS machine using Chef . I was finally able to install it, but when I access the index.php
it just download a file with the content.
I'm guessing it's because Apache (technically Httpd, as I'm with CentOS) doesn't have mod_php
installed/configured.
I installed PHP using php cookbook with the following packages:
# ... code to add webtatic repository to yum
node.set['php']['packages'] = ['php55w', 'php55w-devel', 'php55w-cli', 'php55w-snmp', 'php55w-soap', 'php55w-xml', 'php55w-xmlrpc', 'php55w-process', 'php55w-mysqlnd', 'php55w-pecl-memcache', 'php55w-opcache', 'php55w-pdo', 'php55w-imap', 'php55w-mbstring']
If I'm right, the code above didn't install mod_php
. The following is my web chef recipe:
httpd_service 'apps' do
mpm 'prefork'
action [:create, :start]
listen_ports ['80', '443']
end
# ... code for virtual hosts
# Install the mod_php Apache module.
# httpd_module 'php' do
# instance 'apps'
# end
I had the httpd_module 'php'
directive uncommented when using PHP 5.4. What's the correct name for the http_module to work with PHP 5.5?
It looks like you've found one of the people who went the Debian route and set their packages up as php55-
instead of php-
. That makes things a pain if you want to go from 5.5 to any higher version, because you're having to uninstall those and install the new ones (ie php70-
).
Instead I recommend switching your recipe to the Remi repo and use the php-
packages.
All that having been said, php55w
is your base PHP package. I don't see a php55w-common
package tho. Try adding that (or php-common
) and that should get it into Apache.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.