I have a J2.5site set up that uses language. Thus the urls look something like this:
https://www.mysite.com/en/
and
https://www.mysite.com/en/my-component/
and
https://www.mysite.com/en/my-component/my-alias
I have also set up a script that emails me whenever a 404 or 500 etc occurs:
Here is the result of one (of hundreds):
500 - Error: 500
Invalid controller: name='index', format=''
Call stack
Function Location
1 JSite->dispatch() /opt/host/apps/joomla/htdocs/index.php:42
2 JError::raiseError() /opt/host/apps/joomla/htdocs/includes/application.php:208
3 JError::raise() /opt/host/apps/joomla/htdocs/libraries/joomla/error/error.php:251
URL:/en/index.php
Notice the request. If I understand correctly, nothing should ever ask for /en/index.php. since by that time, it has already been interpreted by the entry index.php and therefore appends '/en/'
I am not getting any request errors in my apache logs or any other apache errors.
All that is happening is that I am being bombarded with emails stating that something tried to access http://www.mysite.com/en/index.php or https://www.mysite.com/en/my-component/index.php and thus either generated a 404 or 500 error
Is this spider (search engine bot) issues or is it a server misconfiguration?
Thanks
Jacques
Related
As a prelude, I know what a HTTP 500 is, and I know how to fix them.
On PHP 5.3, i'm running a production environment with show_errors off. When there are any fatal errors, the user gets a plain white 500 page in response. I'm trying to create a 500 error page just in case there any any errors; just so it is more user friendly.
I used to be able to do
ErrorDocument 500 500.html
It doesn't seem to be working anymore, however - even thought my 404
ErrorDocument 404 404.html
Works fine.
Curious to see solutions regarding this -
Thank you for your time.
Fatal errors don't produce 500 errors in and of themselves, they would return 200 with blank page typically (if no output had been flushed to browser at the point of the error) . Plus this will not help you anyway, as Apache would be no longer involved when PHP is having the error.
Maybe you could register a shutdown function to send 500 header (to get 500 result) and display the content you want to display.
In my codeigniter application I am repeatedly getting this error message in log files.
ERROR - 2016-06-10 00:15:19 --> 404 Page Not Found: /index
How to know what is causing this error, as me and my team have ran through whole website multiple times and didnt found it.
Somewhere in your application you're hitting /index ( eg. www.example.com/index) .. but you don't have a controller named Index.php defined. Thus resulting in 404 Page Not Found.
You don't have a route defined as index, or you don't have a controller defined as Index. A 404 Error is exactly that. The page wasn't found.
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No
indication is given of whether the condition is temporary or
permanent.
If the server does not wish to make this information available to the
client, the status code 403 (Forbidden) can be used instead. The 410
(Gone) status code SHOULD be used if the server knows, through some
internally configurable mechanism, that an old resource is permanently
unavailable and has no forwarding address.
As a prelude, I know what a HTTP 500 is, and I know how to fix them.
On PHP 5.3, i'm running a production environment with show_errors off. When there are any fatal errors, the user gets a plain white 500 page in response. I'm trying to create a 500 error page just in case there any any errors; just so it is more user friendly.
I used to be able to do
ErrorDocument 500 500.html
It doesn't seem to be working anymore, however - even thought my 404
ErrorDocument 404 404.html
Works fine.
Curious to see solutions regarding this -
Thank you for your time.
Fatal errors don't produce 500 errors in and of themselves, they would return 200 with blank page typically (if no output had been flushed to browser at the point of the error) . Plus this will not help you anyway, as Apache would be no longer involved when PHP is having the error.
Maybe you could register a shutdown function to send 500 header (to get 500 result) and display the content you want to display.
I am using the Codeigniter framework in a project - I have a tool which reads an array and sends out over 10,000 emails using the SwiftMailer Email framework.
One form which I have once submitted is supposed to send out each individual email, however it doesnt sent out all of them as after a period of time I get the following error:
404 Page Not FoundThe page you requested was not found. - 500.shtml
The page itself doesnt actually redirect anywhere else so cannot understand why it would be saying this - anyone have any ideas?
Thanks
It looks like you're actually ending up with a 500 error, but when CI tries to display the custom error page for a 500 error (500.shtml), it can't find it, and so throws a 404 instead. Check your logs for the cause of the 500 error.
It'll be a custom error page, probably set up on the web server itself. If it's an Apache server, check the httpd config and remove any ErrorDocument directives you don't want so you can see the actual error.
As Tom said, if this is happening after a significant delay, you're likely getting a timeout. The length of timeouts can be increased from the PHP end using set_time_limit() or the php.ini setting max_execution_time. However in general if you have a long-running task it is much better to run it in a background process than try to shoehorn it into an HTTP request.
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to make PHP set HTTP status code to 500 automatically in case of any error condition? (including those that cannot be handled by user)
I want to configure Apache to send to the user a 500 response with a custom 500 page when a PHP script raises a fatal error.
What I have now is that it will print the error inline with the page content which is good for development but not for production.
How do I configure Apache to send the user a 500 response with a custom page?
Assuming that you don't only want to send a 500 header (which is easy), but really trigger a 500 error in Apache's system, there seems to be no trivial solution.
According to this question, it is PHP's default behaviour since PHP 5.2.4 if:
a fatal error occurs and
the document body is empty (Gordon found the changelog entry here).
I'm not sure how reliable this behaviour is long term (i.e. when PHP 6 comes up etc.). It's not a much advertised feature.
Other than that, I know of no way of provoking a 500 once the script runs. I asked something similar for 404s once. The answer provided there (redirecting to a predefined URL, and sending a 500 header) may be the best you can get - although that of course won't be logged.
I would say that
ErrorDocument 500 /some/page.php
should do the trick, or just a nice HTML page if you want to be sure that it renders properly even when strange things are preventing PHP pages to render.
In order to trigger the error page you look at this anser : How to return an HTTP 500 code on any error, no matter what
I want to do the same thing but I don't think it is possible with the current version of PHP. First, there is a bug where 500 errors return 200 status. So setting the ErrorDocument 500 in your config file will have no effect. In addition, there appears to be no way to access error information (for custom display and logging) even if it could be redirected.
Triggering an error is easy though. Just add this to a PHP file:
throw new Exception();