- PHP version :
PHP 8.1.23 (cli) (built: Sep 15 2023 21:56:29) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.23, Copyright (c) Zend Technologies
with Zend OPcache v8.1.23, Copyright (c), by Zend Technologies
runkit7 version: 4.0.0a6
OS version and compiler version
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="aaaa:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
- Problem is : runkit7_function_remove() is not working. 502 error occur in nginx error log. Sample code:
$user = Auth::user();
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
try {
// Remove the function of laravel helper *__* function
if (function_exists('__')) {
runkit7_function_remove('__');
}
}catch(\Exception $e){
Log::debug($e->message);
}
define('WP_USE_THEMES', true);
require(public_path() . '/wp/wp-blog-header.php');
- I want to remove laravel helper function because of Laravel helper function and WordPress function conflict.
in wordpress: __ function is in public/wp/wp-includes/l10n.php.[link]
in laravel : __function is in vendor/laravel/framework/src/Illuminate/Foundation/helpers.php [link]
I want to close the issue. Finally, I get the ans.
I edit the line WP's l10n.php to before line of laravel's autoload.php calling in public/index.php
i.e: in Laravel's public/index.php,