Apache ERR_CONNECTION_REFUSED в Ubuntu с включенным php - PullRequest
0 голосов
/ 27 декабря 2018

Контекст: Я пытаюсь скопировать свой сайт Wordpress - WP локально в Ubuntu.Моя конечная цель - перенести ее на Django-CMS.

Я использую Vagrant с Virtualbox - VB.Стек ламп устанавливается в VB с Apache / 2.4.29, Ubuntu 18.04.1 LTS и PHP 7.2.

Когда я загружаю следующую страницу PHP ('bonjour.php'):

<html>
 <head>
  <title>Test PHP</title>
 </head>
 <body>
 <?php echo '<p>Bonjour le monde depuis ' . dirname( __FILE__ ) . '</p>'; ?>
 </body>
</html>

все хорошо.Я получаю страницу как:

Bonjour le monde depuis /var/www/math-wp

Однако, когда я пытаюсь загрузить index.php страницу из Wordpress:

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

Я получаю сообщение об ошибке ERR_CONNECTION_REFUSED при достижении localhost page.

Что может быть основной причиной ошибки?Как я могу расследовать?Существуют ли файлы журнала, которые могут быть полезны?

Некоторые дополнительные элементы:

  • MySQL установлен и работает нормально.
  • Я могу получить доступ к WP DB, указанной вwp-config.php с именем пользователя и паролем, указанными в одном файле.
  • Я изменил в WP DB site_url и home_url (с wp CLI) на http://localhost.

Спасибо!

Если это может быть полезно, я использую файл конфигурации Apache2:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        #
        ServerAdmin webmaster@localhost
        # ServerName math-wp.com
        # ServerAlias www.math-wp.com
        DocumentRoot "/var/www/math-wp"
        DirectoryIndex bonjour.php
        <Directory "/var/www/math-wp">
                Options +FollowSymLinks
                AllowOverride all
                Require all granted
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.math-wp.com.log
        CustomLog ${APACHE_LOG_DIR}/access.math-wp.com.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

1 Ответ

0 голосов
/ 29 декабря 2018

Я наконец нашел ошибку.

Произошла ошибка в файле wp_config.php.Странно добавление команды wp

define('WP_DEBUG', false);

решило проблему.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...