Nginx sends status 200 after PHP parse error - linux

I've configured nginx with php-fpm on Ubuntu (and everything works pretty well).
One thing I encountered is that HTTP status code 200 is sent, when a PHP parse error occurs. The error log contains the following entry:
[error] 3205#0: *2854 FastCGI sent in stderr: "PHP Parse error: syntax error, unexpected T_REQUIRE_ONCE in /var/www/.../index.php on line 32" while reading response header from upstream, client: 1.2.3.4, server: example.com; request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "example.com"
I was not able to figure out, why not a code 50x is sent. I have not configured any error_page settings and I read the documentation of error_page. I also tried it to set the status code (with error_page 500 =500 /50x.html and so on). But always status 200 is returned.
I can send status headers from PHP (header('HTTP/1.1 404 Not Found')), this works. However, for errors issued by the PHP interpreter (also uncaught exceptions), the server's response doesn't take into account that an error occurred.

FYI, this is now fixed in Xdebug (2.2) for PHP 5.4 and up. Sadly, it needed a change in PHP to make it work that could not be back-ported to 5.3.

Related

Git Clone error: RPC failed; HTTP 302 curl 22 The requested URL returned error: 302

I want to git clone some code from an url, but I got the following error:
error: RPC failed; HTTP 302 curl 22 The requested URL returned error: 302
fatal: The remote end hung up unexpectedly
The thing is I re-install the OS Linux Ubuntu LTS.18.04, but my another 18.04 Linux machine works fine for this command. I searched from the Internet that error code 302 means redirection errors, but this is a warning, not an error, so could someone help me with this ? Thanks.

Cachet: Dashboard login outputs 500 error

So, I'm trying to set this up since yesterday.
As one of the troubleshooting steps I tried to change the directory in cachet-installation/bootstrap/autoload.php to the full path of the directory. After I knew that it doesn’t work I changed it back, but it just doesn’t wanna apply. I tried clearing the cache folder, but still nothing. This is copied from the nginx log: PHP message: PHP Fatal error: require(): Failed opening required '/home/cachet/www/bootstrap/home/cachet/www/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/cachet/www/bootstrap/autoload.php on line 28" while reading response header from upstream, client: x.x.x.x, server: status.sqlstatement.de, request: "GET /setup HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-cachet.sock:", host: "status.sqlstatement.de", referrer: "https://status.sqlstatement.de/setup".
I hope somebody here can help me.
I just reinstalled the server and it worked.

Magento 2 Installation - Key must not exceed 56 bytes

I'm having issues installing Magento 2 via command line. When setup is running it gets to:
Module 'Magento_Indexer':
Running recurring..
And it throws an error:
[Magento\Framework\Exception\LocalizedException]
Key must not exceed 56 bytes.
I have searched around and couldn't find any clues as to what it can be. I thought the --key might be too long for Magento setup but I have tried the setup without --key, as it is optional but the error still occurs.
2016/07/08 14:42:49 [error] 30074#30074: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Key must not exceed 56 bytes.' in /magento/lib/internal/Magento/Framework/Encryption/Crypt.php:58
Stack trace:
0 /magento/lib/internal/Magento/Framework/Encryption/Encryptor.php(401): Magento\Framework\Encryption\Crypt->__construct('oon5eeRee7yiemo...', 'blowfish', 'ecb', false)
1 /magento/lib/internal/Magento/Framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('oon5eeRee7yiemo...', 0, false)
2 /magento/app/code/Magento/Config/Model/Config/Backend/Encrypted.php(107): Magento\Framework\Encryption\Encryptor->decrypt('PayPal')
3 /magento/lib/internal/Magento/Framework/App/Config/MetadataProcessor.php(86): Magento\Config\Model\Config\Backend\Encrypted->processValue('PayPal')
4 /magento/lib/internal/Magento/Framework/App/Config/Data.php(32): Magento\Framework\App\Config\MetadataPr" while reading response header from upstream, client: 127.0.0.1, server: www.magentotest.com, request: "GET /setup/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.magentotest.com"
If anyone could help that would be great, thank you!
app/etc/env.php is populated with the details of your installation. Look at the contents crypt, and make sure that key doesn't have multiple lines appended to it, as was the case in my new installation, after running the setup:install multiple times.
Changing this key for a current install would obviously be a bad idea. If this fixes you out, please let me know so I can log a ticket.

500 internal server error on gitlab

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#gitlab.dev.sample.com 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.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.0-fips DAV/2 Phusion_Passenger/4.0.42 mod_bwlimited/1.4 mod_fcgid/2.3.9 Server at gitlab.dev.sample.com Port 80

Could not retrieve catalog from remote server: Error 400 on SERVER: Error 403 on SERVER: Forbidden request:

I am trying to follow the documentation at this link:
http://docs.puppetlabs.com/pe/latest/quick_start.html
When I get to the part where one runs ...
sudo puppet agent --test
I get this error message ...
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Error 403 on SERVER: Forbidden request: red-cricket-pe-master (xxx.xxx.xxx.xx) access to /facts/red-cricket-agent [save] authenticated at line 45
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
Thanks
Red
Found my answer here: https://serverfault.com/questions/491623/puppet-enterprise-2-7-error-400-on-server-error-403-on-server-cant-puppet/493085#493085
Looks like you HAVE TO install the console.

Resources