Wp content plugins query monitor wp content db php

Где я могу найти WP_CONTENT_DIR в структуре WordPress?

Я использую плагин Query Monitor, но он не создал символическую ссылку db.php в path/to/wordpress/wp-content/db.php, даже если я изменил разрешение для папки wp-content. Мое разрешение на изменение ограничено одной папкой или файлом каждый раз. Я не могу выполнять запросы Linux или командной строки Windows. Внутри папки query-monitor есть только один db.php.

Это цитата из плагина Query Monitor:

Когда Query Monitor не может найти символическую ссылку на свой файл db.php

Иногда у PHP не будет правильных разрешений для размещения этой символической ссылки. Query Monitor по-прежнему будет нормально работать в этой ситуации, но вы не увидите расширенную информацию, которая делает Query Monitor гораздо более полезным.

Вы можете вручную создать символическую ссылку, выполнив следующую команду в командной строке:

Linux / OS X:

ln -s /path/to/wordpress/wp-content/plugins/query-monitor/wp-content/db.php /path/to/wordpress/wp-content/db.php

Windows (требуются права администратора):

mklink C: \ path \ to \ wordpress \ wp-content \ db.php C: \ path \ to \ wordpress \ wp-content \ plugins \ query-monitor \ wp-content \ db.php

> Кроме того, вы можете ослабить права доступа к файлам в каталоге WP_CONTENT_DIR, а затем деактивировать и повторно активировать плагин, и он попытается снова создать символическую ссылку.

Изменение запроса-монитора или папки wp-content на 777 и деактивация + повторная активация плагина не имеет никакого эффекта. Я не думаю, что я могу изменить разрешения в phpMyAdmin, но не знаю, могу ли я или нет для таблицы, и не знаю, как найти и изменить разрешения для этой таблицы.

Является ли WP_CONTENT_DIR файлом php или строкой в ​​файле, таблице или чем-то еще, и где он находится?

Если это строка в файле php, как я могу изменить права доступа в строке php?

Читайте также:  Телеканал ТНТ

1 ответ

После многих попыток я узнал. Одна важная вещь: нужен путь, который начинается с / home и не может быть сделан в автономном режиме, иначе вы получите конфликт, потому что он указывает на ваш компьютер.

Не нужно ничего скачивать.

Cpanel может иметь Cron Jobs, которая позволяет использовать одну командную строку оболочки linux bash, как показано в этой статье (они не размещают меня). Клиент SSH также может сделать это, но это более сложно.

Перейдите в Advanced, затем Cron Jobs, затем установите один раз в минуту:

ln -s /home/YOUR_HOST_USER_OR_ID/public_html/YOUR_BLOG_FOLDER/wp-content/plugins/query-monitor/wp-content/db.php /home/YOUR_HOST_USER_OR_ID/public_html/YOUR_BLOG_FOLDER/wp-content/db.php 

Обновляйте до тех пор, пока файл не будет создан, затем сразу же удалите задание Cron, чтобы избежать повторения x2 на 2-й минуте.

Так вот так вы избежите обеих ошибок:

Расширенная информация запроса, такая как компонент и затронутые строки, недоступна. Query Monitor не смог найти символическую ссылку на свой файл db.php. Смотрите эту вики-страницу для получения дополнительной информации.

Расширенная информация запроса, такая как компонент и затронутые строки, недоступна. Имеется конфликтующий файл db.php. Смотрите эту вики-страницу для получения дополнительной информации.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Clone this wiki locally

In addition to the main plugin files, Query Monitor includes a file named db.php which gets symlinked into your wp-content directory when the plugin is activated. This special file is a WordPress dropin plugin and it allows Query Monitor to provide extended functionality such as the result count, full stack trace, and error detection for all database queries.

Occasionally the PHP process won’t be able to put this symlink in place. Some common causes are:

  • The file permissions of the wp-content directory means it isn’t writable by PHP
  • Another wp-content/db.php file is already in place
  • Files for the site were copied from elsewhere (eg. during a migration from another hosting provider) and the existing symlink no longer points to a valid location
Читайте также:  Тег input, атрибут type

When Query Monitor is unable to symlink its db.php file into place

Query Monitor will still work fine in this situation but you won’t see extended information that makes Query Monitor much more useful.

In this situation you can create the symlink manually using one of the methods below.

Relax the file permissions

Relax the file permissions on the wp-content directory so it’s writable by the PHP process, then de-activate and re-activate Query Monitor and it’ll attempt to create the symlink again.

Query Monitor includes a WP-CLI command for putting the symlink into place:

If you don’t have access to WP-CLI you can run a command to create the symlink manually:

ln -s /path/to/wordpress/wp-content/plugins/query-monitor/wp-content/db.php /path/to/wordpress/wp-content/db.php 

Windows (requires administrator privileges):

mklink C:\path\to\wordpress\wp-content\db.php C:\path\to\wordpress\wp-content\plugins\query-monitor\wp-content\db.php 

Via your hosting control panel

If you’re unable to do any of the above you should be able to use your web hosting control panel (such as Plesk or cPanel) to create the symlink. Contact your web host if you’re unsure.

When an existing db.php file is already in place

The db.php file will sometimes conflict with another plugin that also uses a db.php file. Such plugins include:

There is nothing that can be done about this. This a WordPress core limitation due to the fact that the dropin plugin file must be called db.php and placed in the wp-content directory, and only one can exist there.

Does Query Monitor help you debug your site without pulling your hair out?
If so, please consider sponsoring my work on Query Monitor ❤️ . Thanks!

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Читайте также:  Php день без ведущего нуля

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

«Extended query information. is not available. A conflicting db.php file is present» when using Query Monitor’s db.php #247

«Extended query information. is not available. A conflicting db.php file is present» when using Query Monitor’s db.php #247

Comments

I’m seeing the above message even though db.php was correctly symlinked (also tried copying) in wp-content. We typically use hyperdb, but I replaced it on a dev site with QM’s db.php, but I’m continuing seeing the same message.

It seems that the code responsible is:

if ( apply_filters( 'qm/show_extended_query_prompt', true ) && ! $db->has_trace && ( '$wpdb' === $name ) ) < echo ''; echo ''; if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) < /* translators: 1: Symlink file name, 2: URL to wiki page */ $message = __( 'Extended query information such as the component and affected rows is not available. A conflicting %1$s file is present. See this wiki page for more information.', 'query-monitor' ); > else < /* translators: 1: Symlink file name, 2: URL to wiki page */ $message = __( 'Extended query information such as the component and affected rows is not available. Query Monitor was unable to symlink its %1$s file into place. See this wiki page for more information.', 'query-monitor' ); > 

Is it possible that it’s displaying the wrong message if has_trace is not available for some reason? I think mysql doesn’t have tracing anymore by default, or is it some other tracing? Any other ideas why this may not be working?

System: OpenSUSE 42.1, latest WP 4.7, apache 2.4, mysql 5.7 client libs, mysql 5.6 server.

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью