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.
Related
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.
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
I recently started to experience this error on a web application that I deployed. It starts at random and the application will give this error for a long period of time (about 1 day or 2). If I try to access it through the direct IP instead of the DNS, it will work normally. But it's important to point out that it's not the DNS problem because I already managed to get this error when using direct address IP as well.
Server Settings:
CentOS release 6.5 (Final)
PHP 5.3.3
Apache/2.2.15 (Unix)
ERROR LOG: [Thu Jul 02 13:25:26 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
Note: Nothing else relevant shows up in the ERROR LOG file.
Today, this same error happened to a different application at my localhost. The same thing as always. When accessing http://localhost/path/to/application it gives me the error and when accessing http://127.0.0.1/path/to/application it works just fine.
My Machine:
Windows 8.1
WampServer 2.2
PHP 5.6.2
Apache 2.4.10
Error Log: [Thu Jul 02 13:21:44.506151 2015] [mpm_winnt:warn] [pid 2428:tid 1496] (OS 64)The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.
I'm looking for any suggestion on what I should be focusing my attention to try and figure out what is causing this problem. Any help at all.
Side Note
My researched indicated that Google Chrome has some issue with displaying this error. This is not the case. When facing this problem, it will happen at any browser in the affected computer.
It is also important to mention that when one person is facing this problem, it does not mean everyone accessing the server will be facing it as well. Apparently, only people that access the application multiple times in a given day will face this error.
At the SERVER application, I've already documented 4 different people facing this problem at different computers, networks, browsers, etc;
At the localhost application (My Machine), it started today.
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
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.