Fatal error related to magic_quotes in PHP - php

So I'm trying to figure out a website error for my friend. Unfortunately, I'm not that good at PHP and unfortunately his website is...ancient. I tried referring to other questions here, but as my code example looks a tad different, I'm worried about messing something up.
Right now, the site is permanently down with the following error:
Fatal error: Uncaught Error: Call to undefined function
set_magic_quotes_runtime() in
/customers/1/f/7/WEBSITEDOMAIN.COM/httpd.www/includes/framework.php:21 Stack
trace: #0 /customers/1/f/7/WEBSITEDOMAIN.COM/httpd.www/index.php(22):
require_once() #1 {main} thrown in
/customers/1/f/7/WEBSITEDOMAIN.COM/httpd.www/includes/framework.php on line 21
So, I referred to the website files, oddly enough, there are four framework.php files but I assume some of them might be irrelevant. All of them contain the following code somewhere around line 21:
#set_magic_quotes_runtime( 0 );
#ini_set('zend.ze1_compatibility_mode', '0');
So, my idea is, remove it all, or just the first line as the error message refers to. This is what the other questions on SO hinted at, as the first line is completely irrelevant with the newest php version. However, as this is a business website I'm also hesitant to mess around, even more so as the owner understands nothing about code.
Any pointers for a complete newbie? (Websitedomain.com is an example address)
Thanks

Related

Fatal error: Uncaught Error: Call to undefined function wp() in /home/customer/www/monkinsider.com/public_html/wp-blog-header.php:16 Stack trace:

Fatal error: Uncaught Error: Call to undefined function wp() in /home/customer/www/monkinsider.com/public_html/wp-blog-header.php:16 Stack trace: #0 /home/customer/www/monkinsider.com/public_html/index.php(17): require() #1 {main} thrown in /home/customer/www/monkinsider.com/public_html/wp-blog-header.php on line 16
I don't know but since last week I am getting this error. My site is hosted on siteground and there are no updates from my side. Also, when I contacted them they said its Wordpress issue and they cant help. I tried to restore backup but only it works for 5 minutes after that error shows up again. Also, I referred to previous articles and everything seems fine the file wp-config and all. Also,I cannot even open my admin Wordpress panel.
That's a malware.
You should scan your server and restore wp-blog-header.php with a default one.
You can download a fresh version here: https://wordpress.org/download/releases/
You won't be able to restore the account until the malware is deleted
I had the same issue. In my case wp-load.php was empty for some reasons, not sure what caused it. I copied the files content from a different website and it fixed the issue.

How to attach stack trace to error log messages in PHP?

I run multiple WordPress sites which have multiple themes and plugins from multiple different authors. I always check my error log and try to contact the authors to fix bugs in their code, but a lot of them are logged as something like:
PHP Deprecated: wpmu_new_blog is <strong>deprecated</strong> since version 5.1.0! Use wp_insert_site instead. in /wp-includes/functions.php on line 5148
PHP Warning: array_merge(): Argument #3 is not an array in /wp-includes/class-wp-customize-widgets.php on line 376
PHP Warning: Error while sending QUERY packet. PID=23688 in /wp-includes/wp-db.php on line 2033
PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /wp-includes/wp-db.php on line 1635
As you can see, the warnings occurred in files inside wp-include, which are available to all plugin/theme/core authors, so there is no way for me to find out who called the deprecated function, passed the wrong function parameters or whatever they did.
I also cannot easily reproduce the error in a dev environment because I don't know what action triggered it.
Everything would be much easier if I could change some PHP (or even server) setting that would cause a stack trace to be appended to each error log message.
This is one of those things that, as common as my problem probably is, Google is unhelpful because all search results try to explain how to append the stack trace to my own code, not to anyone's code.
You could install the Xdebug extension to PHP, which overrides the error logging mechanism of PHP and adds stack traces to errors, warnings, etc. when enabled. See Xdebug documentation.

Fatal error: Uncaught Error: Class 'Route' not found in C:\xampp\htdocs\code\project\routes\web.php:18

I have a basic Laravel project, didn't do anything to it, I just did laravel new project. I started Xampp and turned on MYSQL and APACHE, and when I try to access localhost/{path}/project I get this:
Fatal error: Uncaught Error: Class 'Route' not found in
C:\xampp\htdocs\code\project\routes\web.php:18 Stack trace: #0 {main} thrown in
C:\xampp\htdocs\code\project\routes\web.php on line 18
I don't know if this is dumb, but I looked into web.php, and i don't even have 18 lines... it only has 16... Why is this happening, what should I do?
Laravel expects that it is sitting at the root directory of your nginx/apache configuration. If it sits in a subfolder, you need to configure a rewrite to handle the route accordingly. See this link or this link for details on how to appropriately set this up.
I did manage to figure this out. The problem was that i was trying to open the wrong file... I didn't really understand what everything does, but I'm getting there. Anyway, if there is anyone that has the same problem as me, HERE is the YouTube video that helped me. Hope it is useful for someone!

Getting fatal error config.php line 14

I am making my forum!
I have sql database and everything that I need to publish to the web (domain etc.)
So after launching my forum to the web I am getting the following error when trying to open my forum:
Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in /storage/ssd5/357/5453357/public_html/config.php:14
Stack trace: #0 /storage/ssd5/357/5453357/public_html/main.php(3):
include() #1 {main} thrown in
/storage/ssd5/357/5453357/public_html/config.php on line 14
I tried everything but nothing worked!
Maybe someone from here can answer my question...
How to fix this?
Try mysqli_connect() instead, ‘mysql’ is deprecated. This is the case for every mysql function, so make sure everything is updated to ‘mysqli’. Hope this helps

Zend session_start gives Fatal error: Exception thrown without a stack frame in Unknown on line 0

When running a Zend application locally I get Fatal error: Exception thrown without a stack frame in Unknown on line 0, i traced that error to a line $startedCleanly = session_start();
I can't get through it, when I restart the server and reload the page I do not get the error, but on every other reload I get it, I looked into a php/tmp dir too see if there are any files, and as I see they aren't there. I think that session isn't written but when I try just a simple test.php file with session_start(); line, without zend framework, I see that there is a file created in that dir.
I really don't know where to go next.
Happens when your destructor or error handler throws an exception. That can happen for multiple reasons depending on your exact setup and method for session storage you're using. For example the session directory is not writeable or does not exist, database is not accessible or fields are invalid, redis does not respond, etc.
So, check your settings and look for something that would prevent saving the session data.
More elaborate description can be found here.
I know this post is old, but I've just figured out that I was getting "Fatal error: Exception thrown without a stack frame in Unknown on line 0" because my 'modified' and 'lifetime' columns were of type 'timestamp without time zone' when they should have been 'integer' (I'm using Postgres 9 BTW)
Hope this helps someone.
The problem could also be a disk full problem !!!

Categories