Title: Uncaught Error: Path cannot be empty
Last modified: April 6, 2023

---

# Uncaught Error: Path cannot be empty

 *  Resolved [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/)
 * Hello,
 * when enabling the plugin and opening the file, I got this error:
 *     ```wp-block-code
        Fatal error: Uncaught Error: Path cannot be empty
       in /<path to wordpress>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/helpers.php on line 148
       ```
   
 * Do I miss a setting ?
   Thanks for any help!

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/page/2/?output_format=md)

 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16634299)
 * There is no setting. Deactivate and reactivate. Let me know if the error persists
   as I’ve not seen it before.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16635463)
 * Hello,
 * reactivated did the trick at first but then it came up again – and I can reproduce
   it. 
   Here my steps:
    - activate plugin
    - getting the notice in the top bar (quick debug look menu) that variable is
      not there
    - activated debugging via tools -> wp debugging -> WP_DEBUG true
    - did some stuff
    - looked at the file via quick debug look -> all fine
    - deactivated debugging via tools -> wp debugging -> WP_DEBUG false
    - back to the file -> getting the exception. I would have expected that I would
      be able to look at the file even with debugging deactivated. Since usually
      you turn on debugging on a live system only for a short time and then turning
      it off to view at the file without clogging it with new messages.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16635622)
 * Some strange thing happened also: I deactivated WP_DEBUG but on my website, PHP
   errors were still shown (all options of the plugin were unchecked). I had to 
   deactivate the whole plugin to get rid of the error messages on the blog itself.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16636045)
 * The Debug Quick Look menu is part of WP Debugging. If the plugin is not active
   it won’t be there.
 * Can you share a complete stacktrace of the error?
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16637396)
 * Is your server able to create a `debug.log` file? That is the file that is “missing”.
   It should be created. If you selected ‘Purge File’ from the menu.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16640160)
 * > The Debug Quick Look menu is part of WP Debugging. If the plugin is not active
   > it won’t be there.
 * Yes, that I know. That is not the problem. But maybe I misworded it, since english
   is not my native tongue. When deactivating the WP_DEBUG constant via your plugin,
   I still get debugging messages on my blog. The constants WP_DEBUG is deleted 
   from wp_config.php but it still seems to do the output. And there is no other
   definition of WP_DEBUG anywhere, I double checked. When I deactivate your plugin
   completely, the messages are gone.
 * > Can you share a complete stacktrace of the error?
 * I assume you mean the path error ? Sure:
 *     ```wp-block-code
       Fatal error: Uncaught ValueError: Path cannot be empty in /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/helpers.php:148 Stack trace: 
       #0 /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/helpers.php(148): file_put_contents('', '') 
       #1 /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/parser.php(37): DebugQuickLook\Helpers\check_debug_file() 
       #2 /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/actions.php(59): DebugQuickLook\Parser\run_parse() 
       #3 /<path to wp>/wp-includes/class-wp-hook.php(308): DebugQuickLook\Actions\run_quicklook_action('') 
       #4 /<path to wp>/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(true, Array) 
       #5 /<path to wp>/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 
       #6 /<path to wp>/wp-admin/admin.php(175): do_action('admin_init') 
       #7 /<path to wp>/wp-admin/index.php(10): require_once('/is/htdocs/wp12...') 
       #8 {main} thrown in /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/helpers.php on line 148
   
       Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/handler.php:253 Stack trace: 
       #0 /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/handler.php(130): DebugQuickLook\Handler\load_handler_message(Object(WP_Error)) 
       #1 /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/handler.php(40): DebugQuickLook\Handler\handler_body_tag(Object(WP_Error), Array) 
       #2 /<path to wp>/wp-includes/functions.php(3722): DebugQuickLook\Handler\build_handler(Object(WP_Error), '', Array) 
       #3 /<path to wp>/wp-includes/class-wp-fatal-error-handler.php(239): wp_die(Object(WP_Error), '', Array) 
       #4 /<path to wp>/wp-includes/class-wp-fatal-error-handler.php(154): WP_Fatal_Error_Handler->display_default_error_template(Array, true) 
       #5 /<path to wp>/wp-includes/class-wp-fatal-error-handler.php(58): WP_Fatal_Error_Handler->display_error_template(Array, true) 
       #6 [internal function]: WP_Fatal_Error_Handler->handle() 
       #7 {main} thrown in /<path to wp>/wp-content/plugins/wp-debugging/vendor/norcross/debug-quick-look/includes/handler.php on line 253
       ```
   
 * > Is your server able to create a `debug.log` file? That is the file that is “
   > missing”. It should be created. If you selected ‘Purge File’ from the menu.
 * It’s created and filled when WP_DEBUG is true, it’s still there when WP_DEBUG
   is deactivated. But then I get that error above. 
   I hope this helps.
 * Let me know what else I can do to give you as much information as possible.
    -  This reply was modified 3 years, 1 month ago by [dragon013](https://wordpress.org/support/users/dragon013/).
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16640359)
 * I’ve update the Debug Quick Look code in the `develop` branch. Can you test to
   see if it fixed your issue?
 * [https://github.com/afragen/wp-debugging/archive/refs/heads/develop.zip](https://github.com/afragen/wp-debugging/archive/refs/heads/develop.zip)
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16647506)
 * I did a quick check and the errors are still there.
 * I also tried it with another wordpress installation where no errors occur. So
   maybe it interferes with a plugin or configuration. I will have a look into this
   later this week and will tell you insights then.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16647890)
 * Just a quick follow-up: Even with no other plugins activated beside the develop
   branch version of your plugin, the errors persist.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16648594)
 * I tried it on two different wordpress installations with the same result. I looked
   into the code but since I am not really into wordpress plugin development, I 
   do not really understand what is happening. It’s just strange that this:
 *     ```wp-block-code
       apply_filters( Core\HOOK_PREFIX . 'debug_file', Core\DEBUG_FILE )
       ```
   
 * returns a path when WP_DEBUG is true but none if false. I would expect it to 
   return a path no matter what is set since there is not condition around it. But,
   as said: I do not really understand the purpose of apply_filters.
   This one:
 *     ```wp-block-code
       $debug = empty( $debug ) ? @ini_set( 'error_log', \WP_CONTENT_DIR . '/debug.log' ) : $debug;
       ```
   
 * sets an option in PHP when $debug is empty, right ? But it does not give anything
   back. 
   So $debug is still empty when entering:
 *     ```wp-block-code
       if ( false === file_exists( $debug ) ) {
       		file_put_contents( $debug, '' );
       	}
       ```
   
 * And with that, it fails. Is that on purpose ?
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16649721)
 * Oops, you’re correct. I just updated to use the following.
 *     ```wp-block-code
       	$debug = empty( $debug ) ? \WP_CONTENT_DIR . '/debug.log' : $debug;
       ```
   
 * Download from same link above.
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16675312)
 * Sorry for my late reply, got busy with life. 
   The errors are still there. Wondering
   if I am doing something wrong on my end. But what else can I do than installing
   and setting options ? I might have some time next week to play around more and
   try to see any other things which effect this plugin.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16676291)
 * Can you describe your server setup and is there anything other than a standard
   WordPress installation?
 * Can you install the WordPress Beta Tester plugin and utilize the ‘Report a Bug’
   feature?
 *  Thread Starter [dragon013](https://wordpress.org/support/users/dragon013/)
 * (@dragon013)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16689785)
 * It’s a standard wordpress installation. Server should not have any extras, at
   least I do not know of any. After all, it’s a hosted webserver, so not sure if
   there are any settings different from standard, but so far no problems.
 * The “report a bug” gives:
 *     ```wp-block-code
       == Bug Report
       === Description
       Describe the bug.
   
       === Environment
       - WordPress: 6.2.1-alpha-55679
       - PHP: 8.0.28-he.0
       - Server: Apache
       - Database: mysqli (Server: 5.7.41-44-log / Client: mysqlnd 8.0.28-he.0)
       - Browser: Chrome 112.0.0.0 (Windows 10/11)
       - Theme: Login Form Child 1.0
       - MU-Plugins: None activated
       - Plugins: 
         * Better Search Replace 1.4.2
         * Childify Me 1.2.3
         * CryptX 3.3.3.2
         * IP2Location Country Blocker 2.28.9
         * Password Protect WordPress Lite 1.8.8
         * Simple Local Avatars 2.7.4
         * Slimstat Analytics 5.0.4
         * Statify 1.8.4
         * Statify Filter 1.6.2
         * Statify – Extended Evaluation 2.6.3
         * Stream 3.9.2
         * WordPress Beta Tester 3.3.7
         * WP Debugging 2.11.20.4
         * WP Word Count 3.2.4
   
       === Steps to Reproduce
       1. 
       x. 🐞</img> Bug occurs.
   
       === Expected Results
       1.  ✅</img> What should happen.
   
       === Actual Results
       1.  ❌</img> What actually happened.
       ```
   
 * 
   I noticed that I got 2 errors with the non-develop version of your plugin. With
   the develop version I get one, in a different location, I think. Here is, what
   I got (with version ….4):
 *     ```wp-block-code
       Fatal error: Uncaught ValueError: 
       Path cannot be empty in /<path to wp>/wp-content/plugins/wp-debugging-develop/vendor/norcross/debug-quick-look/includes/parser.php:68 
       Stack trace: 
       #0 /<path to wp>/wp-content/plugins/wp-debugging-develop/vendor/norcross/debug-quick-look/includes/parser.php(68): file('', 6) 
       #1 /<path to wp>/wp-content/plugins/wp-debugging-develop/vendor/norcross/debug-quick-look/includes/parser.php(51): DebugQuickLook\Parser\parse_debug_file('') 
       #2 /<path to wp>/wp-content/plugins/wp-debugging-develop/vendor/norcross/debug-quick-look/includes/actions.php(59): DebugQuickLook\Parser\run_parse() 
       #3 /<path to wp>/wp-includes/class-wp-hook.php(308): DebugQuickLook\Actions\run_quicklook_action('') 
       #4 /<path to wp>/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) 
       #5 /<path to wp>/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 
       #6 /<path to wp>/wp-admin/admin.php(175): do_action('admin_init') 
       #7 /<path to wp>/wp-admin/index.php(10): require_once('<path to wp>') 
       #8 {main} thrown in /<path to wp>/wp-content/plugins/wp-debugging-develop/vendor/norcross/debug-quick-look/includes/parser.php on line 68
       ```
   
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/#post-16690581)
 * OK, I went nuclear and pretty sure I’ve solved the issue now in the develop branch
   link above. Unfortunately it means if the debug.log file path cannot be found
   then Debug Quick Look doesn’t load.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/page/2/?output_format=md)

The topic ‘Uncaught Error: Path cannot be empty’ is closed to new replies.

 * ![](https://ps.w.org/wp-debugging/assets/icon.svg?rev=2842498)
 * [WP Debugging](https://wordpress.org/plugins/wp-debugging/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-debugging/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-debugging/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-debugging/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-debugging/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/uncaught-error-path-cannot-be-empty/page/2/#post-16699705)
 * Status: resolved