Getting error Use of undefined constant ABSPATH - assumed 'ABSPATH' - wordpress

We're getting this error in the error logs for our WordPress website. This comes once or twice a day but we're not able to understand exactly what is causing this error.
[25-Jan-2023 01:57:54 UTC] PHP Warning: Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in /home/username/public_html/wp-includes/class-wp-http.php on line 11
[25-Jan-2023 01:57:54 UTC] PHP Warning: Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in /home/username/public_html/wp-includes/class-wp-http.php on line 11
[25-Jan-2023 01:57:54 UTC] PHP Warning: require(ABSPATHWPINC/class-requests.php): failed to open stream: No such file or directory in /home/username/public_html/wp-includes/class-wp-http.php on line 11
[25-Jan-2023 01:57:54 UTC] PHP Warning: require(ABSPATHWPINC/class-requests.php): failed to open stream: No such file or directory in /home/username/public_html/wp-includes/class-wp-http.php on line 11
[25-Jan-2023 01:57:54 UTC] PHP Fatal error: require(): Failed opening required 'ABSPATHWPINC/class-requests.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/username/public_html/wp-includes/class-wp-http.php on line 11
[25-Jan-2023 01:57:55 UTC] PHP Fatal error: Uncaught Error: Class 'WP_Dependencies' not found in /home/username/public_html/wp-includes/class-wp-scripts.php:18
Stack trace:
#0 {main}
thrown in /home/username/public_html/wp-includes/class-wp-scripts.php on line 18
[25-Jan-2023 01:57:56 UTC] PHP Fatal error: Uncaught Error: Class 'WP_Dependencies' not found in /home/username/public_html/wp-includes/class-wp-styles.php:18
Stack trace:
#0 {main}
thrown in /home/username/public_html/wp-includes/class-wp-styles.php on line 18
[25-Jan-2023 01:58:15 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_the_block_template_html() in /home/username/public_html/wp-includes/template-canvas.php:12
Stack trace:
#0 {main}
thrown in /home/username/public_html/wp-includes/template-canvas.php on line 12
[25-Jan-2023 01:58:37 UTC] PHP Warning: Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in /home/username/public_html/wp-includes/blocks/index.php on line 8
[25-Jan-2023 01:58:37 UTC] PHP Warning: Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in /home/username/public_html/wp-includes/blocks/index.php on line 8
[25-Jan-2023 01:58:37 UTC] PHP Warning: require(ABSPATHWPINC/blocks/legacy-widget.php): failed to open stream: No such file or directory in /home/username/public_html/wp-includes/blocks/index.php on line 11
[25-Jan-2023 01:58:37 UTC] PHP Warning: require(ABSPATHWPINC/blocks/legacy-widget.php): failed to open stream: No such file or directory in /home/username/public_html/wp-includes/blocks/index.php on line 11
[25-Jan-2023 01:58:37 UTC] PHP Fatal error: require(): Failed opening required 'ABSPATHWPINC/blocks/legacy-widget.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/username/public_html/wp-includes/blocks/index.php on line 11
[25-Jan-2023 01:58:50 UTC] PHP Fatal error: Uncaught Error: Class 'WP_Widget' not found in /home/username/public_html/wp-includes/widgets/class-wp-widget-block.php:17
Stack trace:
#0 {main}
thrown in /home/username/public_html/wp-includes/widgets/class-wp-widget-block.php on line 17
We've tried going through the whole WordPress code base including themes and plugins files to see if any of that is causing the issue but we've not been able to figure out the root cause of this.

It's possible these errors are due to a cybercriminal or script kiddie probing your site with URLs that try to run php scripts buried within WordPress.
The missing ABSPATH definition gives that away. The first thing wp_load.php does when somebody hits a legitimate WordPress page is define that ABSPATH symbol.
Then, many WordPress modules use it. If it's missing you get that error.
Unfortunately, sites on the public net get routinely hammered by these script-kiddie requests. There's nothing much to be done except keeping your software up to date.
If you look at your webserver log at the same timestamp as the messages you showed us, you'll probably find the offending request or requests.

Related

Issue with cache Symfony2

I have a problem when I make a change in symfony2 and when I refresh the page, the cache does not get regenerated. The log tells me the following:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\Config\\FileLocator' not found in /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache:2812\nStack trace:\n#0 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2769): Symfony\\Component\\HttpKernel\\Kernel->getContainerLoader(Object(Symfony\\Component\\DependencyInjection\\ContainerBuilder))\n#1 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2721): Symfony\\Component\\HttpKernel\\Kernel->buildContainer()\n#2 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2493): Symfony\\Component\\HttpKernel\\Kernel->initializeContainer()\n#3 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2531): Symfony\\Component\\HttpKernel\\Kernel->boot()\n#4 /var/www/vhosts/coosur.com/httpdocs/releases/840/web/app.php(18): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#5 {main}\n thrown in /var/www/vhosts/coo...', referer: https://www.XXXX.com/
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\Config\\FileLocator' not found in /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache:2812\nStack trace:\n#0 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2769): Symfony\\Component\\HttpKernel\\Kernel->getContainerLoader(Object(Symfony\\Component\\DependencyInjection\\ContainerBuilder))\n#1 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2721): Symfony\\Component\\HttpKernel\\Kernel->buildContainer()\n#2 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2493): Symfony\\Component\\HttpKernel\\Kernel->initializeContainer()\n#3 /var/www/vhosts/coosur.com/httpdocs/releases/840/app/bootstrap.php.cache(2531): Symfony\\Component\\HttpKernel\\Kernel->boot()\n#4 /var/www/vhosts/coosur.com/httpdocs/releases/840/web/app.php(18): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#5 {main}\n thrown in /var/www/vhosts/XXX...'
Besides, if I make a change and reload the page, the result is the next:
�Tf8utf8_general_ciPRIselect,insert,update,referencesNEVERvarchar(17),8�defpsalocalesactiveNOenumutf8utf8_general_ciselect,insert,update,referencesNEVERtrueenum('false','true')
Any idea?

How to fix WordPress kses error and fatal error handler

I'm new at making website. Even I only know Html Coding. I'm running a website using WordPress, but it is facing problem everyday at same time. Everyday at the same time site is showing Http 500 error.
So as I don't know any kind of coding, every day I have to delete WordPress from my site then again have to install it then I have to restore website using Updraftplus. But I want to fix this oroblem.
I have an option in my cPanel called "Errors". I find this error from there.
I copied what there was said:
1st error:
[Mon Dec 23 03:46:44.895719 2019] [lsapi:error] [pid 1014092:tid 47766993704704] [client 141.8.188.1:46957] [host gokumovie.com] Backend fatal error: PHP Fatal error: Uncaught Error: Call to undefined function esc_url() in /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php:190\nStack trace:\n#0 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)\n#1 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)\n#2 [internal function]: WP_Fatal_Error_Handler->handle()\n#3 {main}\n thrown in /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php on line 190\n
2nd error :
Backend fatal error: PHP Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /home/gokumovi/public_html/wp-includes/formatting.php:4316\nStack trace:\n#0 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...')\n#1 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)\n#2 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)\n#3 [internal function]: WP_Fatal_Error_Handler->handle()\n#4 {main}\n thrown in /home/gokumovi/public_html/wp-includes/formatting.php on line 4316\n

Unable to open the wordpress website getting http error

[14-Sep-2018 07:00:57 UTC] PHP Warning: require(/home/website/public_html/learn/wp-includes/embed.php): failed to open stream: No such file or directory in /home/website/public_html/learn/wp-settings.php on line 201
[14-Sep-2018 07:00:57 UTC] PHP Fatal error: require(): Failed opening required '/home/website/public_html/learn/wp-includes/embed.php' (include_path='.:/opt/alt/php71/usr/share/pear') in /home/website/public_html/learn/wp-settings.php on line 201
Getting this error while trying to open the website which is developed in wordpress.This is the sub domain which we created.
Seems like the embed.php is missing in the given directory . did you check it ?

Laravel Homestead new project error

On my Win8 machine I installed Laravel Homestead box using git. (OracleVM+Vagrant).
Homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: newProject.local
to: /home/vagrant/Code/newProject/public
databases:
- homestead
I start the VM using:
cd Homestead
vagrant up
vagrant ssh
And everything works.
If I understand correctly, I still need to create a newProject in my Code/ folder.
cd Code
composer create-project --prefer-dist laravel/laravel newProject
This would work if I where on a lamp server, but instead I get the following error:
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Installing laravel/laravel (v5.2.15)
- Installing laravel/laravel (v5.2.15)
Loading from cache
Created project in newProject
> php -r "copy('.env.example', '.env');"
> php artisan clear-compiled
PHP Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
Call Stack:
0.0001 352008 1. {main}() /home/vagrant/newProject/artisan:0
0.0001 353760 2. require('/home/vagrant/newProject/bootstrap/autoload.php') /home/vagrant/newProject/artisan:16
PHP Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line 17
Call Stack:
0.0001 352008 1. {main}() /home/vagrant/newProject/artisan:0
0.0001 353760 2. require('/home/vagrant/newProject/bootstrap/autoload.php') /home/vagrant/newProject/artisan:16
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
PHP Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line
17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
Any ideas why would that happen?
I tried to cp a working project and still get the required error.
I found similar errors that had something to do with missing dependencies, but shouldn't Homestead deal with that by himself?
Looks like this was a composer problem. I just tried again and it works. More about it on Laravel News: https://laravel-news.com/2016/03/may-need-update-composer-json-file/

Drupal have error Fatal error: require_once(): Failed opening required

Fatal error: require_once(): Failed opening required '/home/webmaster/main/sites/all/modules/advanced_forum/includes/views/advanced_forum_handler_field_node_topic_iconinc' (include_path='.:/usr/share/php:/usr/share/pear') in /home/webmaster/main/includes/bootstrap.inc on line 3186
I update module after that have error.
First, check integrity of your module.
Second, if your module is okay use registry_rebuild. Place it on your sites/all/modules folder and call (registry_rebuild.php).
Example with your browser : http://yourdomain.local/sites/all/modules/registry_rebuild/registry_rebuild.php

Resources