0

我的 php/apache 配置有问题。文件将通过 http 呈现良好。但是,通过 https 会提示下载/保存文件。奇怪的是图像是通过 https 渲染的。

SSL 配置经过测试,已在多个站点上正确安装。另外,应该注意的是,这是在 plesk 环境中,但我是通过 shell 访问安装的。

虚拟主机部分如下:

 AddType text/html .php 
 AddType application/x-httpd-php .php

   ErrorLog /etc/httpd/logs/smartsites_error_log

   CustomLog /etc/httpd/logs/smartsites_access_log common

ServerName secure.cognitionsmartsites.com

     <Directory "/var/www/vhosts/default/htdocs">
    Allow from all
            Options +Indexes
</Directory>

    IndexOptions
ServerAlias  secure.cognitionsmartsites.com

#UseCanonicalName Off
DocumentRoot /var/www/vhosts/default/htdocs

#ScriptAlias /cgi-bin/ "/var/www/vhosts/default/cgi-bin/"

SSLEngine On

#SSLVerifyClient none
#SSLCertificateFile /usr/local/psa/var/certificates/cert-L6E8a0

    SSLCertificateFile /usr/local/psa/var/certificates/cert.crt
    SSLCertificateKeyFile /usr/local/psa/var/certificates/private.key
    SSLCertificateChainFile /usr/local/psa/var/certificates/intermediate.crt

4

1 回答 1

0

AddType将第 2 行更改为AddHandler. 这将告诉 php 处理您的 .php 文件,而不是像AddType这样设置 mimetype。

<?php另外,请确保您的 php 代码以<?.

于 2013-04-08T20:14:29.740 回答