• Resolved greatpages

    (@greatpages)


    Hi Alan & Team,

    I’m referring to this topic, just wasn’t able to add a new comment:
    https://www.ads-software.com/support/topic/deprecated-commands-with-php-8/

    Working on a new project currently and due to the fact the hoster is close to switching or already switched to PHP 8 I decided to give it a new try.
    Unfortunately I’m still facing the issue that while trying to sync folder content the only result is an internal server error (500).
    Following up on this I took a look into the php error log.

    This is the message:

    [Wed Feb 22 14:57:11.018304 2023] [php:error] [pid 2612:tid 1848] [client ::1:54579] PHP Fatal error: Uncaught ValueError: Path cannot be empty in C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php:3120\nStack trace:\n#0 C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php(3120): file_get_contents(”)\n#1 C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php(4704): MGMediaLibraryFolders->max_sync_contents(‘109’)\n#2 C:\xampp\htdocs\my-page.de\wp-includes\class-wp-hook.php(308): MGMediaLibraryFolders->mlfp_run_sync_process(”)\n#3 C:\xampp\htdocs\my-page.de\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)\n#4 C:\xampp\htdocs\my-page.de\wp-includes\plugin.php(517): WP_Hook->do_action(Array)\n#5 C:\xampp\htdocs\my-page.de\wp-admin\admin-ajax.php(188): do_action(‘wp_ajax_mlfp_ru…’)\n#6 {main}\n thrown in C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php on line 3120, referer: https://localhost/my-page.de/wp-admin/admin.php?page=mlf-folders8

    It’s not required for me to get this resolved, although it would be great, but I expected this to be probably helpful for you guys.
    If there’s anything else regarding debug logs that I can provide you with just let me know.

    Beside that thanks for your awesome work! Keep up your great attitude!
    All the best to you and the rest of the team, best regards

    -Bj?rn

    • This topic was modified 1 year, 9 months ago by greatpages.

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author AlanP57

    (@alanp57)

    Using Media Library Folders 8.0.5 I’m able to sync will no issues when using PHP 8.0.8. Are you using version 8.0.5 of the plugin and is the file folders_to_hide.txt in the wp-content/plugins/media-library-plus folder?

    Thread Starter greatpages

    (@greatpages)

    Hi Alan,

    thank you for the fast reply.
    I can confirm both of your questions. Version 8.0.5 of Media Library Folders is installed and the file Folders_to_hide.txt is in the path you mentioned.
    Only difference is the PHP version that I’m currently running, which is 8.1.12 in my case.
    WordPress is up to date as well.
    Developing locally on my machine I’m using XAMPP to provide the required server environment.

    Already disabled all other plugins, checked server settings, deleted browser cache and tried again, but always with the same result. Tested on latest Chrome and Firefox browsers.
    Aside from the developer tools in Chrome the browser is also giving an error message, but it’s more than general and isn’t giving any details:
    “There was a critical error on your webpage. Learn more about troubleshooting within WordPress.”

    The last time I was facing this issue I went back to PHP 7.4 and everything worked like a charm again.

    If there’s anything else you would want me to look into, let me know and I’ll happily assist.

    Best regards,

    -Bj?rn

    Plugin Author AlanP57

    (@alanp57)

    Currently, I do not have access to PHP 8.1. Version 8.1 is ahead of the PHP version recommends for WordPress, which is still PHP 7.4. The current version of WordPress only has beta support for PHP 8 and PHP 8.1. Thus I suggest you downgrade to PHP 8 until WordPress is fully compatible with PHP 8.1.

    Thread Starter greatpages

    (@greatpages)

    Will do. ??
    Thanks for you looking into it.

    Best regards,

    -Bj?rn

    Thread Starter greatpages

    (@greatpages)

    Don’t feel bothered by me, just wanted to give you a short feedback.

    Got rid of the complete development environment including WordPress and db.
    Now I’m running WordPress 6.1.1. on PHP 8.0.25. Media Library Folders is installed with version 8.0.6 and the file “Folder_to_Hide.txt” also exists in the plugin’s root folder.
    Browser cache has been deleted within the process of uninstalling and setting up the new environment.
    Permissions to all files and folders are given.
    Unfortunately I’m getting the exact same error at the exact same point (while trying to sync folder content).

    Already tried resetting folder settings, but without success, the error message keeps coming up.

    [Thu Feb 23 23:47:04.248167 2023] [php:error] [pid 1612:tid 1836] [client ::1:51371] PHP Fatal error: Uncaught ValueError: Path cannot be empty in C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php:3124\nStack trace:\n#0 C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php(3124): file_get_contents(”)\n#1 C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php(4738): MGMediaLibraryFolders->max_sync_contents(’15’)\n#2 C:\xampp\htdocs\my-page.de\wp-includes\class-wp-hook.php(308): MGMediaLibraryFolders->mlfp_run_sync_process(”)\n#3 C:\xampp\htdocs\my-page.de\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)\n#4 C:\xampp\htdocs\my-page.de\wp-includes\plugin.php(517): WP_Hook->do_action(Array)\n#5 C:\xampp\htdocs\my-page.de\wp-admin\admin-ajax.php(188): do_action(‘wp_ajax_mlfp_ru…’)\n#6 {main}\n thrown in C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php on line 3124, referer: https://localhost/my-page.de/wp-admin/admin.php?page=mlf-folders8

    Best regards,

    -Bj?rn

    Thread Starter greatpages

    (@greatpages)

    UPDATE:
    Now that’s mysterious…

    Uninstalled everything, including deleting registry, browser cache, wordpress files & db.
    Re-installed and set up new instance now running on PHP 8.0.8, because that seemed to be the version you were still able to sync folders with.
    But unfortunately the error is still occuring. Same error message, thrown in C:\xampp\htdocs\my-page.de\wp-content\plugins\media-library-plus\media-library-plus.php on line 3124.
    Even increased max_execution_time to 300 as suggested in your FAQ, but without any success.

    Will try even fewer releases of PHP now.

    Best regards,

    -Bj?rn

    • This reply was modified 1 year, 9 months ago by greatpages.
    Thread Starter greatpages

    (@greatpages)

    LATEST UPDATE:
    I’m done for today.

    Tested with PHP 8.0.5, 8.0.0 and just to make sure with 7.4. All tests have been performed under same conditions (settings, themes and plugins).
    Error stopped occuring with the latter (7.4).
    Now I’m more curious to know how you managed to sync folders running PHP 8 than getting this issue resolved. Which browser are you using most of your time? And which version is it?

    Best regards,

    -Bj?rn

    I believe this has nothing to do with the plugin. You are using xammp on Windows as local environment. Xammp has a config file, and I believe the folder path for WordPress is not 100% ok. The site is running obviously, but the plugin picks up the wrong value, or does not find it.

    Maybe this helps finding the cause of the problem

    • This reply was modified 1 year, 9 months ago by Peter Smits.
    Thread Starter greatpages

    (@greatpages)

    Hello Peter,

    thank you for your thoughts on this.
    Might be possible that the issue is located within XAMPP. Am not convinced yet, but my interest is triggered. Will set up a live environment today to dig deeper into this. Keep you posted.

    EDIT:
    While preparing the installation I kept on reading on issues regarding PHP 8 and WordPress.
    In this interesting article I stumbled upon the possibility of a misconfiguration causing a fatal error, which is having strict type checking enabled.
    https://make.www.ads-software.com/core/2020/11/23/wordpress-and-php-8-0/
    To me this is currently the most likely reason for my issues.
    Going to investigate in a fresh XAMPP environment as well.

    Thanks so far, best regards

    -Bj?rn

    • This reply was modified 1 year, 9 months ago by greatpages.
    Thread Starter greatpages

    (@greatpages)

    UPDATE:
    In a live environment using PHP 8.0 folder sync is working fine.
    I’ll leave it at this point as I already spent way too much time on this.

    Thanks for the exchange anyways! Best regards,

    -Bj?rn

    Plugin Author AlanP57

    (@alanp57)

    www.ads-software.com strongly encourages plugin developers to escape URLs using the esc_url() function for security reasons. If we check WordPress’s compatibly with newer PHP versions, see the chart on this page, https://make.www.ads-software.com/core/handbook/references/php-compatibility-and-wordpress-versions/, WordPress is not yet fully compatible with PHP 8.2. I suggest using PHP 8.0 until greater compatibility with PHP 8.2 has been achieved.

    Plugin Author AlanP57

    (@alanp57)

    Ok, I understand. You are saying that since this path to the file is not a URL, it does not need to be escaped. I agree and I will be remove in the next release of the plugin.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Media Library Folders + PHP 8’ is closed to new replies.