Apache server log error. AH00126: Invalid URI in request GET, etc - php

I checked the server log recently, there are so many error types.
1 . AH00126: Invalid URI in request GET /../../terms HTTP/1.1 .
This kind of error is the most common one, our website is on Wordpress. This page is on www.MYSITENAME.com/terms. I check most of the pages, and checked the links, all of them did not cause this invalid Request.
But if I use postman, type the URL directly, like: www.MYSITENAME.com/../terms, this would cause the error and also it would be catched and logged.
Any idea about this error? I search it on google, someone said it is the problem from the .htaccess file, but I dont really understand it.
2. PHP Warning: mysqli_query(): (00000/0): in /var/www/www.MYSITENAME.com/public_html/wp-includes/wp-db.php on line 2007
I have no idea about this one.
3. PHP Fatal error: Out of memory (allocated 20971520) (tried to allocate 77824 bytes)
4. PHP Warning: Error while sending QUERY packet. PID=22936 in /var/www/www.MYSITENAME.com/public_html/wp-includes/wp-db.php on line 2007
5. PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /var/www/www.MYSITENAME.com/public_html/wp-content/plugins/wp-cerber/common.php on line 1968
6. PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /var/www/www.MYSITENAME.com/public_html/wp-content/plugins/wp-cerber/common.php on line 2017
Any idea about Any error?
Thanks.

For the first error:[ AH00126: Invalid URI in request GET /../../terms HTTP/1.1 .], I found out where was going wrong. On my site, sitting on wordpress and also editting from wordpress, we used the relative URL before. Now we fix it to the absolute one.
I have searched for some relevant questions, someone said this kind of problem is caused by crawler program, but others said .htaccess leads the problem. But I do recommend just go through your own code about the URL parts first

Related

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.

function 'remove_comment_support' not found or invalid function name in wordpress

My wordpress blog was previously working in apache server, last week I have moved my site to nginx server.
Now the error showing is,
PHP message: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'remove_comment_support' not found or invalid function name in /var/www/html/demo/blog/wp-includes/class-wp-hook.php on line 298
I have googled many times but no result. I am new to wordpress. Someone please guide me how to fix this problem.

How to resolve file_get_content error and server empty response

Getting this error after I hit this website 20 times IP blocking or any other thing I don't know why.
Warning:
file_get_contents(http://www.azlyrics.com/a.html?time=1454075435):
failed to open stream: HTTP request failed! in
C:\xampp\htdocs\travel\simple_html_dom.php on line 77 Fatal error:
Call to a member function find() on boolean in
C:\xampp\htdocs\travel\searchplaylist.php on line 61
I've Code files
If you want to I'll upload
both file codes in this link
https://drive.google.com/folderview?id=0BzMyD6UnaIfWZDZFWXN3akFwd2s&usp=sharing
Just add # infront of file_get_contents. (#file_get_contents).
This will not raise any errors if the request fails due to any reason.
My issue was that the server i was getting content from might be down sometimes and during those times i got an error. # will not raise them.
But remember to use this only in cases where you understand why it might fail and you just want to handle those cases. Don't use it somewhere where you might have made mistakes and want to hide them.

Randomly getting Cloud Storage Error: UNAUTHORIZED

Today, I started receiving this error for, what I can tell, no reason. This isn't a consistent error. It randomly started today. It was working perfectly yesterday, and for weeks without any error.
All I have in the file is file_get_contents().
I've been using the same code for get_image.php for a while and I have never received this error until now.
Does anyone know why this would be happening randomly and not consistently?
[20/Feb/2015:10:53:53 -0800] "POST /get_image HTTP/1.1" 200 149 - - "website.com" ms=296 cpu_ms=86 cpm_usd=0.000017 pending_ms=160 instance=<string> app_engine_release=1.9.18
W 13:53:53.815 PHP Warning: Cloud Storage Error: UNAUTHORIZED in /base/data/home/runtimes/php/sdk/google/appengine/ext/cloud_storage_streams/CloudStorageReadClient.php on line 310
W 13:53:53.815 PHP Warning: file_get_contents(gs://bucket/image/page_1.png): failed to open stream: "\google\appengine\ext\cloud_storage_streams\CloudStorageStreamWrapper::stream_open" call failed in /base/data/home/apps/..../get_image.php on line 10
EDIT: For anyone looking for updates to this issue, go to this bug report.
Add this to your code as a temporary fix for the time being as per Stuart Langley's post.
apc_delete('_ah_app_identity_:https://www.googleapis.com/auth/devstorage.read_only');
apc_delete('_ah_app_identity_:https://www.googleapis.com/auth/devstorage.read_write');
According to Stuart, the bug has been fixed. You shouldn't randomly receive this error anymore for no reason.

Drupal: Issue in DruTex

I have installed and configured DruTex (in my Drupal6 installation).
But when I go to create a page, a warning appears on the top of the page as:
warning: Parameter 1 to drutex_pdf_nodeapi() expected to be a reference, value given in /usr/share/drupal6/modules/drutex/drutex.module on line 829.
Please help me in removing it.
Note: I used a # in the mentioned file on line 829 however then following errors come when I create a page :
TeX Embedding failed!

Categories