Reputation: 25
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/"
$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');
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]
Upvotes: 0
Views: 177
Reputation: 25
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,
require __DIR__. '/wp/wp-includes/l10n.php';
require __DIR__.'/../vendor/autoload.php';
Upvotes: 0