Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 通过HTTPS访问网站正在中断数据库连接_Php_.htaccess_Codeigniter_Ssl_Ssl Certificate - Fatal编程技术网

Php 通过HTTPS访问网站正在中断数据库连接

Php 通过HTTPS访问网站正在中断数据库连接,php,.htaccess,codeigniter,ssl,ssl-certificate,Php,.htaccess,Codeigniter,Ssl,Ssl Certificate,我有一个运行在Apache web服务器上的codeigniter站点 我从letsencrypt安装了一个SSL 我的网站工作良好,如果我访问它通过 但是, 如果我通过网站访问它,会显示数据库已损坏 这是我的htaccess文件 Include /etc/phpmyadmin/apache.conf <VirtualHost *:80> ServerName example.org ServerAlias www.example.org

我有一个运行在Apache web服务器上的codeigniter站点 我从letsencrypt安装了一个SSL

我的网站工作良好,如果我访问它通过

但是,

如果我通过网站访问它,会显示数据库已损坏

这是我的htaccess文件

Include /etc/phpmyadmin/apache.conf
<VirtualHost *:80>
        ServerName example.org
        ServerAlias www.example.org
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        RewriteEngine on
        RewriteRule   "^/resources/(.+)" "https://example.org/_resources/$1"$
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ProxyPass /api https://localhost:8010/api
        ProxyPassReverse /api https://localhost:8010/api
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName example.org
    ServerAlias www.example.org
    DocumentRoot /var/www/html/
    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/example.org-0001/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.org-0001/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/example.org-0001/chain.pem
</VirtualHost>
Include/etc/phpmyadmin/apache.conf
ServerName example.org
ServerAlias www.example.org
服务器管理员webmaster@localhost
DocumentRoot/var/www/html
重新启动发动机
重写规则“^/resources/(.+)”https://example.org/_resources/$1"$
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
选项索引跟随符号链接多视图
允许超越所有
命令允许,拒绝
通融
ProxyPass/apihttps://localhost:8010/api
ProxyPassReverse/apihttps://localhost:8010/api
ServerName example.org
ServerAlias www.example.org
DocumentRoot/var/www/html/
Include/etc/letsencrypt/options-ssl-apache.conf
斯伦金安
SSLCertificateFile/etc/letsencrypt/live/example.org-0001/cert.pem
SSLCertificateKeyFile/etc/letsencrypt/live/example.org-0001/privkey.pem
SSLCertificateChainFile/etc/letsencrypt/live/example.org-0001/chain.pem

通过添加
标记内部,解决了此问题

  <Directory /var/www/html>
        AllowOverride All 
  </Directory>

允许超越所有

您能否更仔细地描述一下:“数据库坏了”。到底发生了什么?所以当我用“http”访问我的站点时,所有的东西都工作了,所有的链接,所有的动态内容都是从数据库中提取出来的,所有的东西都像它应该的那样工作。当我用“https”点击我的网站时,只有主页有效,没有链接也有效,主页上的动态内容是空白的。