php Server - 500 error message on new files - php

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

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.

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)

MAMP Returning 404 When URL Too Long

I'm working with a GET request that is about 987 characters long and when I'm developing the application locally (PHP), I am seeing a 404 error even though on my web server, the exact application works just fine.
I'm guessing this is a MAMP specific thing because the same application works on the web server.
Interestingly enough, I'm not getting a 414 (Request URI Too Large), I'm receiving a 404.
Any ideas?
Edit: The apache log says:
[Tue May 31 00:35:27 2011] [error] [client ::1] File does not exist: /Users/tim/Desktop/htdocs/index.php/controller/(restofurl)
The rest of the URL contains no offending characters, simply A-Z.
Again, the same request works on a live server, it's just my local environment that's having the issue.
Edit again: If i make a simple PHP script that prints out all GET variables,
http://localhost/test.php?asd=asdasd.......1700chars <--- works fine
However
http://localhost/test.php/asd=asdasd.......1700chars <--- fails
This is quite mysterious..
This looks like your MAMP Server has AcceptPathInfo disabled which is necessary to parse URLs in the
/index.php/something/else
form.
Enable it in your server configuration.

Silverstripe | Internal Server Error

Silverstripe is running on my since a few weeks. Recently, I get an Internal Server Error message when I try to access the admin area.
Having a look in the server's error logs, I discovered following hint:
[Mon Apr 05 12:15:26 2010] [error]
[client ...] Premature end of script
headers: main.php
I already was refered to this site: What does the 'premature end of script headers' error mean?
But does anybody had this problem in connection with Silverstripe? Would make it much easier to restrict the scope from where the error is caused.
Regards,
Benedikt
Well... it seems to work now.
Reason:
SilverStripe required a seperate 'Security.ss'-template for the login area. (I wonder, why it didn't was in need of that, before!)
Unfortunatelly the web server displayed a very general 'Internal Server Error'-Message. When i ran the site on another server, SilverStripe was able to display error messages to me.
insert
Director::set_environment_type("dev");
in your _config.php to see more error messages.
dont use this in live mode, only dev mode.

Odd, nondescript error [an error occurred while processing this directive]

I have been migrating a client's website from a Bluehost account to my own cPanel/WHM setup. I used the cPanel 'Backup Wizard' to create the export .tar (composed of home directory and mysql files, amoung some other things...) I suppose it's possible this is the problem, except that I didn't use the wizard to import the information, I just uploaded the tar.gz and untarred via SSH.
Whenever trying to access any php file, the following nondescript error prints into the php file, here's the file source:
<!-- SHTML Wrapper - 500 Server Error -->
[an error occurred while processing this directive]
I have seen ALOT of errors. However, in 8 years, I have never seen this error. I've spent hours trying to kill the process, re-upload the files, restarting all services. Nobody in my office has seen this error either.
Here's the log error: (some information removed from error, such as php address and remote pathing)
[Thu Feb 11 02:58:23 2010] [error] [client 00.000.0.0] SoftException in Application.cpp:367: Mismatch between target UID (535) and UID (534) of file "/home/site/public_html/index.php"
This same problem went unanswered here:
http://forums.serverbeach.com/showthread.php?t=7906
Isn't this Apache's error message when a SSI or other directive inside the page goes wrong? The "SHTML Wrapper" points to that as well.
Could it be that you have a .htaccess file or a PHP autostart mechanism that embeds the PHP script into a surrounding (S)HTML file? If this is the case, it seems as if the surrounding file and the PHP file have different user IDs.
Can you post the full PHP and/or HTML file, or alternatively your project structure?

Categories