HTTP 500 – Wordpress WP-API without any message? - php

I'm using themosis – a framework for wordpress that works pretty well. Also I use WP-API - that doesn't work so great.
All versions are the latest stables and the Server is using PHP 5.5
On calling that API route:
posts?filter[order]=ASC&filter[orderby]=name&filter[posts_per_page]=-1&type=products
I'm getting an Internal Server error / HTTP 500
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster#example.ch and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.
More information about this error may be available in the server error
log.
So my hoster checked the logs and the only lines caused by this error were:
[Tue Jul 07 17:43:13 2015] [error] Premature end of script headers: php55-fcgi-starter.fcgi, referer: {myurl/mypath}
I checked all log, forced everything to display errors & logs, but no PHP errors - not even notices... (set display_errors to On and error_reporting to 2039 - with htaccess and php-side (wordpress index.php)
I just figured out that when I set the post_per_page filter is set to e.g. 90 it works, but only till a specific post.
All posts are "normal" - making a WP_Query also delivers all results without any issues.
I also increased the php memory_limit to more than enough and tested it locally (Mac OS / MAMP) what works great.
I really can't find any reason why this is happening. My server hoster support (which is really good actually) says also that all systems run fine

Related

PHP/Apache white screen on remote server but local server displays error page

I am working on my own work web framework. My PHP code is working fine on my local development server and on my company's production VPS but when I deploy it to a client's VPS it's displaying "500" in the network tab and a blank white page with no output.
The PHP will catch exceptions as they're encountered (for example, if the user isn't logged in and the page requires being logged in) and then it will display the login page. Or if the user doesn't have permission to access the page, it will give a generic "you don't have permission to view this resource."
All of this works exactly as I intend on my local development server but does not work when deployed on a production machine.
The catch is: on my development server I have xdebug installed but display_errors and display_startup_errors are set to "Off". In fact, besides xdebug being installed, I don't see any major configuration differences between my remote server and local development server.
I've got no idea why this isn't working. To make matters more confusing, this only causes issues on one of my client's VPS's and not my own production VPS.
All machines are running PHP 8.1 and Apache 2. Which config files should I be scrutinizing to figure out what's wrong here? Thanks!
EDIT 1: I enabled the error log and the only thing that's different between a page that renders and a page that does not is this:
[Tue Aug 09 19:49:05.099515 2022] [proxy_fcgi:error] [pid 19302] (22)Invalid argument: [client xxx.xxx.xxx.xxx:51572] AH01075: Error dispatching request to : , referer: https://example.com/
Any thoughts on this? My instinct is something is wrong with php-fpm timing out but as far as I can tell FPM is set up for a 10 minute timeout.

php Server - 500 error message on new files

since about 3 or 4 months, I have the following problem, and I wanted to ask my server provider. It is a php server. But they will probably tell me that it is my mistake so I try here first.
When I copy and paste an existing php file, or create a new php file , by the way only php files, and then try to look at it on my browser, I get the following error:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at ... to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
When I change existing file, then there is NO problem. I usually use a file editor like Notepad qq, but the file manager of the php server gives me the same problem.
Could the problem be in the .ftpaccess or .htaccess file? But why only the new files have a problem? Should I contact my php server administrator?
The error log shows:
[Mon Oct 01 20:15:34.375940 2018] [cgi:error] [pid 33844] [client ...:0] AH01215: suexec policy violation: see suexec log for more details: /home/luedi/www/design/20181001/index.php, referer: ...
What is suexec? Where is the log? I don't use CGI, I think. I don't even know what it is.
Any idea what my problem is? Thanks ...
Without knowing your setup, OS etc I would guess that the issue might be permissions/ownership when you upload the file. Which might be changed after you edit the file.
Upload the file and check the ownership and permissions. Then edit the file and do the same again and check if it has changed.
suEXEC feature provides users of the Apache HTTP Server the ability to run CGI and SSI programs under user IDs different from the user ID of the calling web server. Normally, when a CGI or SSI program executes, it runs as the same user who is running the web server. Continue reading here: https://httpd.apache.org/docs/2.4/suexec.html

mod_fcgid read data timeout - Premature end of script headers

The websites on one of my Plesk users can't be accessed. The server reports a 500 Internal server error, the error_log for that user shows a bunch of
[warn] mod_fcgid: read data timeout in 60 seconds
[error] Premature end of script headers: index.php
The DocumentRoot contains a normal WordPress installation. Other sites running the same WP version, using the same DB server and PHP+Extensions run fine. A <?php phpinfo(); ?> runs fine as well. Calling php index.php from cli returns the webpage, but is a bit too slow for an idle Xeon E5-2620 Server w/ 64GB RAM
Are there any known Problems? How can I debug further?
Some more system info:
PHP 5.6.24 (tried 5.4 as well)
Plesk 12.5.30
EDIT: The Problem occurs intermittently. Right now, no 500 Error is returned, site loads fine (a bit slow). I increased memory_limit, just to be sure it isn't a config limitation
You can try to increase FcgidIOTimeout as described here https://kb.plesk.com/en/121251
Since Plesk 11.5, "FcgidIOTimeout" parameter is set to the same value as max_execution_time php parameter in domain's PHP settings
Also you can try any of PHP-FPM handler instead of FastCGI, because of mod_fcgid has a lot of internal performance limitations which can't be avoided.
The problem was caused by a rogue file_get_contents in some scripts.
I looked through the error log for the 1st appearance of the error message, and found a file created exactly when the error message first appeared - only 2 years earlier...
WordPress Site hacked? Suspicious PHP file
So I removed the malware ( detailed write-up at https://talk.plesk.com/threads/debugging-premature-end-of-script-headers.338956/ ), rebooted the Server and the error is now gone.
Technical detail: The error turned up because the Server distributing the malware is offline. file_get_contents("http..." timed out, the local script failed and returned the error message.

HTTP Error 500.0 - Internal Server Error on wordpress

am new here - I have been having problems with this $%%$%$ IIS7.5 I have finished developing a wordpress site on my localhost using xampp - so I thought this was gonna be business as usual just copy files to remote- change config and dump sql - boy was I wrong! I think I have done everything I know to do and am still getting this annoying HTTP Error 500.0 - Internal Server Error
This is what I get each time,When I am trying to access the site:
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Detailed Error Information
Module
FastCgiModule
Notification
ExecuteRequestHandler
Handler
PHP_via_FastCGI
Error Code
0x00000000
Requested URL
http://mysite.com:80/index.php
Physical Path
E:\HostingSpaces\xxxxxxxxx\mysite.com\wwwroot\index.php
Logon Method
Anonymous
Logon User
Anonymous
Most likely causes: •IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try: •Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
•Check the event logs to see if any additional information was logged.
•Verify the permissions for the DLL.
•Install the .NET Extensibility feature if the request is mapped to a managed handler.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Links and More Information This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
View more information »
Microsoft Knowledge Base Articles:
•294807
Please can anyone just tell me precisely what to do,I cant take it anymore.. please help me.
So my case is hopeless - i cant be helped?
IIS server is not equal to Apache. It uses another type of configs. I think your problem in the web.config file or related to permissions. Your question isn't so subjective. You need to localize problem and describe here more detailed information. Now your question looks like this: "I have PHP application on IIS that doesn't work. I tested it on my xampp. Where is problem?". There are a lot of problems that you can have here...
I has same problem with php 5.6 on iis 6 (windows server 2012 r2)
You should ensure the VC++11 runtime is installed (for me it's Visual C++ Redistributable for Visual Studio 2012 Update 4)
It's probably because the connection string mismatch,check your connection string.
"500 - Internal server error" error message when a user tries to access your Apache or Lighttpd based dynamic php application
Generally, to solve this problem you need to take help of log files located at following location:
=> /var/log/message
=> /var/log/httpd/error_logs (/var/log/lighttpd/error_log or /var/log/httpd/error_log)
This error only occurs because of web server software. However after looking through logs you may not find many details. This problem may be caused by:
A malformed php cgi script
An invalid directive in an .htaccess or other config file
Limitation imposed by file system and server software (for example php log file size set to 10Mb)
Missing php.ini (or cannot read php.ini file)

Server error when taking website live

I made some changes in a website. The website was initial static and to make some changes I changed the links of the website to .php.
I made the changes and it was working perfectly fine in localhost. I saw no errors and no warnings.
However when I moved it to a live server I saw this problem.
Server error
The website encountered an error while retrieving http://prakashchhetri.com.np/projects/hmaloha/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
I faced similar problem before but it was due to some syntax error in my PHP scripts (In my previous projects).
However in this project, I dont think I have made any errors and If I had made any, the project would not run in my localhost.
I checked the website live in two different servers but still the same problem
Be sure to check both apache and php error logs (if they're separate). You'll find your answer in there.
Alternatively, assuming php is the culprit, you can momentarily enable the following settings in php.ini:
display_errors = On
html_errors = On
error_reporting = E_ALL | E_STRICT
just be sure that you disable these again in the future so that you're not exposing users to potentially sensitive information.
make sure the user www-data has permission to read the php script

Categories