php没有通过ssl解析

时间:2014-11-01 10:19:14

标签: php apache ssl

我正在设置基于CentOS 6.5的VPS,带有mod_ssl的Apache 2.2。

我的问题是PHP没有解析通过SSL提供的页面。我的/etc/httpd/conf.d/ssl.conf看起来像:

LoadModule ssl_module modules/mod_ssl.so
Listen 443
SSLPassPhraseDialog  builtin
SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout  300
SSLMutex default

SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

<VirtualHost _default_:443>
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/ssl/certs/example.crt
SSLCertificateKeyFile /etc/ssl/certs/example.key
SSLCertificateChainFile /etc/ssl/certs/chain.txt

<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
LoadModule ssl_module modules/mod_ssl.so
Listen 443
SSLPassPhraseDialog  builtin
SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout  300
SSLMutex default
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
<Directory /var/www/example.com/public_html>
        AllowOverride All
        </Directory>
        DocumentRoot /var/www/example.com/public_html
        ServerName example.com
</VirtualHost>

任何想法会导致php不解析ssl?

1 个答案:

答案 0 :(得分:0)

所以我弄清楚我的问题是什么,也许这可以帮助别人。所以我的SSL Vhost是AllowOverride All,而我的非ssl Vhost是AllowOverride None。

当通过Vhost AllowOverride All设置启用.htaccess文件时,.htaccess文件有一行导致PHP失败:&#34; AddHandler application / x-httpd-php5 .php&#34;

这是错误的并且覆盖了php.conf中的正确配置:&#34; AddHandler php5-script .php&#34;