This topic is locked

Fatal Error When Activating Wordpress Plugin On V11 and wordpress 6.8.1

6/14/2025 12:00:00 PM
PHPRunner General questions
L
lcslouis author
[14-Jun-2025 15:49:15 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/var/www/html/wp-content/plugins/wpphprunner/include/lang/.php' (include_path='.:/usr/local/lib/php') in /var/www/html/wp-content/plugins/wpphprunner/include/phpfunctions.php:3048
Stack trace:
#0 /var/www/html/wp-content/plugins/wpphprunner/include/commonfunctions.php(4825): loadLanguageMessages('')
#1 /var/www/html/wp-content/plugins/wpphprunner/include/dbcommon.php(56): loadLanguage(NULL)
#2 /var/www/html/wp-content/plugins/wpphprunner/wpphprunner.php(25): require_once('/var/www/html/w...')
#3 /var/www/html/wp-admin/includes/plugin.php(2387): include_once('/var/www/html/w...')
#4 /var/www/html/wp-admin/includes/plugin.php(673): plugin_sandbox_scrape('wpphprunner/wpp...')
#5 /var/www/html/wp-admin/plugins.php(60): activate_plugin('wpphprunner/wpp...', 'http://localhos...', false)
#6 {main}
thrown in /var/www/html/wp-content/plugins/wpphprunner/include/phpfunctions.php on line 3048

Currently Installed on Docker Testing Enviorment
i'm using the wordpress Docker Image wordpress version 6.8.1
Php runner V 11.0 Build 43509
Using Wordpress plugin
Built my Project And then uploaded the plugin to wordpress.

other wordpress plugins install without issue

the wpsettings table is in the database

ChatGPT 6/14/2025

The error message you've encountered indicates that the PHP script is attempting to include a language file from a specific path, but it cannot find the file because the filename is empty (.php). This typically happens when the function that determines the language file to load does not receive a valid language code.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Language Settings:
    Make sure that the language settings in your PHPRunner project are correctly configured. In PHPRunner, you should specify a valid language for your project. If the language is not set or is an empty string, it could lead to this issue.


  2. Verify Language Files:
    Navigate to the include/lang/ directory of the PHPRunner plugin and check if the language files are present. You should see files named like en.php, fr.php, etc. If the necessary language files are missing, you may need to re-upload them or check your PHPRunner project settings to ensure they were generated correctly.


  3. Modify the Code:
    If the language is set to an empty string, you can modify the loadLanguageMessages function call in the phpfunctions.php file to set a default language if none is provided. For example, you could change it to fallback to English if no language is specified:

    function loadLanguageMessages($lang = 'en') {
    // Your existing code
    }

  4. Rebuild the Plugin:
    If you've made changes to the language settings or if files were missing, rebuild your PHPRunner project and upload the plugin again.


  5. Debugging:
    Add some debugging statements in your phpfunctions.php file before the line that throws the error to log the value of the language variable being passed. This can help you understand why it is empty:

    error_log('Loading language: ' . $lang);
  6. Check Plugin Compatibility:
    Ensure that the version of PHPRunner and the WordPress plugin are compatible with your version of WordPress (6.8.1). Occasionally, updates to WordPress can lead to compatibility issues with certain plugins.


  7. Consult Documentation:
    Check the PHPRunner documentation or forums for any known issues or specific instructions regarding language settings and file structure.


  8. Check Permissions:
    Ensure that the Docker environment has the necessary permissions to read the language files. File permission issues may prevent PHP from accessing certain files.



By following these steps, you should be able to diagnose and potentially fix the issue with PHPRunner in your WordPress Docker environment. If the problem persists, consider reaching out to PHPRunner support or community forums for more specialized assistance.

L
lcslouis author 6/15/2025

hardcoding to English solved the activation issue on phpfunctions.php

From

function loadLanguageMessages( $filename ) {
require_once( getabspath( 'include/lang/' . $filename . '.php' ) );
}

To This

function loadLanguageMessages( $lang = 'en' ) {
require_once( getabspath( 'include/lang/English.php' ) );
}