Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.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 本地测试环境(Mamp Pro 4)对Ubuntu 16.04生产服务器的问题_Php_Wordpress_Apache - Fatal编程技术网

Php 本地测试环境(Mamp Pro 4)对Ubuntu 16.04生产服务器的问题

Php 本地测试环境(Mamp Pro 4)对Ubuntu 16.04生产服务器的问题,php,wordpress,apache,Php,Wordpress,Apache,我已经在本地测试环境中完成了网站的设置,一切正常。我已经在运行Ubuntu 16.04的计算引擎服务器上建立了一个GCP(谷歌云平台)帐户。我已尽我所能安装了LAMP stack(devops工程师如果看到我的作品会流下一滴眼泪),并通过wget下载了一份存档文件,复制了我的网站。我把我的网站复制到/var/www/html,它加载了一些插件,但我有几个插件不起作用。这些包括和。基于此,我推断问题一定是因为缺少PHP扩展或缺少Apache模块 我用这段代码列出了PHP扩展 <?php

我已经在本地测试环境中完成了网站的设置,一切正常。我已经在运行Ubuntu 16.04的计算引擎服务器上建立了一个GCP(谷歌云平台)帐户。我已尽我所能安装了LAMP stack(devops工程师如果看到我的作品会流下一滴眼泪),并通过
wget
下载了一份存档文件,复制了我的网站。我把我的网站复制到
/var/www/html
,它加载了一些插件,但我有几个插件不起作用。这些包括和。基于此,我推断问题一定是因为缺少PHP扩展或缺少Apache模块

我用这段代码列出了PHP扩展

<?php 
      echo "<pre>";
      print_r(get_loaded_extensions());
      echo "<pre/>";
 ?>
对于Apache模块,我发出了以下命令:

Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php7_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 socache_shmcb_module (shared)
 ssl_module (shared)
 status_module (shared)
以下是输出:

apache2ctl -M
error_reporting(-1);
ini_set('display_errors', 1);

我不确定问题出在哪里,这正是我所认为的。

我会检查错误日志,如果错误报告没有打开,我会打开它

这将向您显示是否缺少任何扩展,并可能说明正在发生的事情


希望这能有所帮助。

检查错误日志,打开错误报告,这将有助于了解任何缺失的扩展。如果您没有迁移数据库,请确保在wordpress中打开插件。插件的配置以及哪些是打开的都存储在数据库中。谢谢,这说明了问题所在。这让我在vhost中启用了AllowOverride all,它成功了。如果你愿意回答,我将把它标为解决方案。这是一个最快的修复记录,所以!!!当然,这通常是第一步,让PHP告诉您出了什么问题。
error_reporting(-1);
ini_set('display_errors', 1);