我有一台正在运行的 RHEL 6.7 服务器:Apache:2.2.15 PHP 5.3.3 getenforce => 已禁用
就目前而言,它运行良好。服务器的网站管理员告诉我,PHP-5.3 将不再适用于 Facebook 的 API,我需要升级到 5.4 或更高版本。为了做到这一点,我按照以下步骤操作http://developerblog.redhat.com/2013...6-using-rhscl/ 我唯一真正做的改变是:'rhn-channel --add --channel=rhel-x86_64-server-6-rhscl-1',因为这篇文章有点过时了。除此之外,我严格遵循了步骤。我甚至得到了
"[warn] module php5_module is already loaded, skipping"
为了解决这个问题,我执行了“mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.php5.3”以防止它在 Apache 启动时运行。然后我重新启动了 Apache。这是我在错误日志中得到的内容。
[Wed Nov 11 11:41:59 2015] [notice] caught SIGTERM, shutting down
[Wed Nov 11 11:41:59 2015] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)
[Wed Nov 11 11:41:59 2015] [notice] Digest: generating secret for digest authentication ...
[Wed Nov 11 11:41:59 2015] [notice] Digest: done
[Wed Nov 11 11:41:59 2015] [notice] Apache/2.2.15 (Unix) PHP/5.4.40 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
'httpd -M | grep php' 显示:
Syntax OK
php5_module (shared)
当我尝试加载网页而不是像以前一样执行 index.php 时,我得到的只是一个空白页。我想我错过了一些简单的东西。下面是我当前的 /etc/httpd/conf.d/php54-php.conf
有人知道我该如何让它正确运行 index.php 吗?非常感谢您抽出时间。
麦克风
我的评论以 3 个 # 开头。例如 ###
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp54-php5.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
<FilesMatch \.php$>
### Shows a blank page instead of running the PHP code.
SetHandler application/x-httpd-php
### Shows the PHP source code instead of running it
#SetHandler application/x-httpd-php5
</FilesMatch>
#
# Allow php to handle Multiviews
#
#
AddHandler php5-script .php AddType text/html .php
### Seems to have no effect
#AddType application/x-httpd-php .php
### Seems to have no effect
#AddType application/x-httpd-php-source .phps
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.phps$>
# SetHandler application/x-httpd-php-source
#</FilesMatch>
#
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path "/opt/rh/php54/root/var/lib/php/session"