Jump to content

500 instead of 404


sonar
 Share

Recommended Posts

Hello, all,

I created a processwire site and I have a problem: I get a 500 internal server error, instead of a 404, when visiting a non-existant URL

If I visit a non-existant URL when logged in as admin, I get this error:

Error: Exception: Operator '&' is not supported for 'status'. (in /home/user/example.com/wire/core/PageFinder.php line 2211)

#0 /home/user/example.com/wire/core/PageFinder.php(1212): ProcessWire\PageFinder->getQueryNativeField(Object(ProcessWire\DatabaseQuerySelect), Object(ProcessWire\SelectorBitwiseAnd), Array, Array, Object(ProcessWire\Selectors))
#1 /home/user/example.com/wire/core/Wire.php(386): ProcessWire\PageFinder->___getQuery(Object(ProcessWire\Selectors), Array)
#2 /home/user/example.com/wire/core/WireHooks.php(813): ProcessWire\Wire->_callMethod('___getQuery', Array)
#3 /home/user/example.com/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'getQuery', Array)
#4 /home/user/example.com/wire/core/PageFinder.php(410): ProcessWire\Wire->__call('getQuery', Array)
#5 /home/user/example.com/wire/core/Wire.php(386): ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors

In attempts to solve the problem, I tried the following:

  • created a `404.html` in the web root and edited `.htaccess` to `ErrorDocument 404 /404.html` as suggested here. It works great with requests like `https://example.com/lll ooo`, but, as explained in the article, it doesn't (and shouldn't) work with `https://example.com/lllooo`. Still 500 error.
  • Created a `404.php` in `/site/templates/` and used it as a template for the 404 Page. I can view `example.com/404http` (the exact page URL), but with an actual non-existant page, still 500 error.
  • Added `$config->http404PageID = 27;` in `site/config.php` (though the line already exists in `wire/config.php`, still no luck.

Due to the `&` symbol in the error message when logged in, I cannot correctly google the error.

For reference, I use ProcessWire 3.0.143, PHP 7.3, MySQL 5.7.
Any insight? I don't know how to even start to troubleshoot this, any sort of hint is appreciated.

Link to comment
Share on other sites

It's probably not an issue with a missing 404.html/.php or a missing config entry.

But I'm happy to see you worked through possible solutions.

Possible reasons

  1. As you are using a DEV release there can be a problem with an installed (3rd party) module.
  2. Maybe it's just an error in a query/selector you are using in your template.php or _init.php or init.php or ready.php -  yes, there are several possible reasons for that error but let's start at the beginning.

Did you just installed ProcessWire or are you in the middle of an ongoing project?

If you just installed ProcessWire you want to look in your .htaccess file  - look here: https://processwire.com/docs/start/install/troubleshooting/#resolving-an-apache-500-error and check if mod_rewrite is enabled.

If you are in an ongoing project open up the used template, take a look at your page selectors there and doublecheck them.

 

Btw... welcome to the forums!

  • Like 3
Link to comment
Share on other sites

Wow, thank you both so much for answering so quickly!

6 hours ago, wbmnfktr said:

As you are using a DEV release there can be a problem with an installed (3rd party) module.

 

Ahh, I feel stupid now. I downloaded the dev release two months ago, when I was still playing with Processwire and before deciding to use it... looks like I forgot that I was not using stable.

Thanks for your help and for the welcome ?

2 hours ago, Robin S said:

Thank you! Upgrading to the 3.0.146 version fixed the error immediately.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...